home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Programming / fpc / amigaunits / amigados.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-09-22  |  111.5 KB  |  4,009 lines

  1. {
  2.     This file is part of the Free Pascal run time library.
  3.  
  4.     A file in Amiga system run time library.
  5.     Copyright (c) 1998 by Nils Sjoholm
  6.     member of the Amiga RTL development team.
  7.  
  8.     See the file COPYING.FPC, included in this distribution,
  9.     for details about the copyright.
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14.  
  15.  **********************************************************************}
  16.  
  17. unit amigados;
  18.  
  19. INTERFACE
  20.  
  21. uses exec, utility, timer;
  22.  
  23. Const
  24.  
  25. { Predefined Amiga DOS global constants }
  26.  
  27.     DOSTRUE     = -1;
  28.     DOSFALSE    =  0;
  29.  
  30. { Mode parameter to Open() }
  31.  
  32.     MODE_OLDFILE        = 1005;         { Open existing file read/write
  33.                                           positioned at beginning of file. }
  34.     MODE_NEWFILE        = 1006;         { Open freshly created file (delete
  35.                                           old file) read/write }
  36.     MODE_READWRITE      = 1004;         { Open old file w/exclusive lock }
  37.  
  38. { Relative position to Seek() }
  39.  
  40.     OFFSET_BEGINNING    = -1;           { relative to Begining Of File }
  41.     OFFSET_CURRENT      = 0;            { relative to Current file position }
  42.     OFFSET_END          = 1;            { relative to End Of File }
  43.  
  44.     BITSPERBYTE         = 8;
  45.     BYTESPERLONG        = 4;
  46.     BITSPERLONG         = 32;
  47.     MAXINT              = $7FFFFFFF;
  48.     MININT              = $80000000;
  49.  
  50. { Passed as type to Lock() }
  51.  
  52.     SHARED_LOCK         = -2;           { File is readable by others }
  53.     ACCESS_READ         = -2;           { Synonym }
  54.     EXCLUSIVE_LOCK      = -1;           { No other access allowed }
  55.     ACCESS_WRITE        = -1;           { Synonym }
  56.  
  57. Type
  58.  
  59.     FileHandle  = BPTR;
  60.     FileLock    = BPTR;
  61.  
  62.     pDateStamp = ^tDateStamp;
  63.     tDateStamp = record
  64.         ds_Days         : Longint;      { Number of days since Jan. 1, 1978 }
  65.         ds_Minute       : Longint;      { Number of minutes past midnight }
  66.         ds_Tick         : Longint;      { Number of ticks past minute }
  67.     end;
  68.  
  69. Const
  70.  
  71.     TICKS_PER_SECOND    = 50;           { Number of ticks in one second }
  72.  
  73. {$PACKRECORDS 4}
  74. Type
  75.  
  76. { Returned by Examine() and ExInfo(), must be on a 4 byte boundary }
  77.  
  78.     pFileInfoBlock = ^tFileInfoBlock;
  79.     tFileInfoBlock = record
  80.         fib_DiskKey      : Longint;
  81.         fib_DirEntryType : Longint;
  82.                         { Type of Directory. If < 0, then a plain file.
  83.                           If > 0 a directory }
  84.         fib_FileName     : Array [0..107] of Char;
  85.                         { Null terminated. Max 30 chars used for now }
  86.         fib_Protection   : Longint;
  87.                         { bit mask of protection, rwxd are 3-0. }
  88.         fib_EntryType    : Longint;
  89.         fib_Size         : Longint;      { Number of bytes in file }
  90.         fib_NumBlocks    : Longint;      { Number of blocks in file }
  91.         fib_Date         : tDateStamp;   { Date file last changed }
  92.         fib_Comment      : Array [0..79] of Char;
  93.                         { Null terminated comment associated with file }
  94.         fib_OwnerUID     : Word;
  95.         fib_OwnerGID     : Word;
  96.         fib_Reserved     : Array [0..31] of Char;
  97.     end;
  98.  
  99. Const
  100.  
  101. { FIB stands for FileInfoBlock }
  102.  
  103. {* FIBB are bit definitions, FIBF are field definitions *}
  104. {* Regular RWED bits are 0 == allowed. *}
  105. {* NOTE: GRP and OTR RWED permissions are 0 == not allowed! *}
  106. {* Group and Other permissions are not directly handled by the filesystem *}
  107.  
  108.     FIBB_OTR_READ       = 15;   {* Other: file is readable *}
  109.     FIBB_OTR_WRITE      = 14;   {* Other: file is writable *}
  110.     FIBB_OTR_EXECUTE    = 13;   {* Other: file is executable *}
  111.     FIBB_OTR_DELETE     = 12;   {* Other: prevent file from being deleted *}
  112.     FIBB_GRP_READ       = 11;   {* Group: file is readable *}
  113.     FIBB_GRP_WRITE      = 10;   {* Group: file is writable *}
  114.     FIBB_GRP_EXECUTE    = 9;    {* Group: file is executable *}
  115.     FIBB_GRP_DELETE     = 8;    {* Group: prevent file from being deleted *}
  116.  
  117.     FIBB_SCRIPT         = 6;    { program is a script (execute) file }
  118.     FIBB_PURE           = 5;    { program is reentrant and rexecutable}
  119.     FIBB_ARCHIVE        = 4;    { cleared whenever file is changed }
  120.     FIBB_READ           = 3;    { ignored by old filesystem }
  121.     FIBB_WRITE          = 2;    { ignored by old filesystem }
  122.     FIBB_EXECUTE        = 1;    { ignored by system, used by Shell }
  123.     FIBB_DELETE         = 0;    { prevent file from being deleted }
  124.  
  125.     FIBF_OTR_READ      = (1 shl FIBB_OTR_READ);
  126.     FIBF_OTR_WRITE     = (1 shl FIBB_OTR_WRITE);
  127.     FIBF_OTR_EXECUTE   = (1 shl FIBB_OTR_EXECUTE);
  128.     FIBF_OTR_DELETE    = (1 shl FIBB_OTR_DELETE);
  129.     FIBF_GRP_READ      = (1 shl FIBB_GRP_READ);
  130.     FIBF_GRP_WRITE     = (1 shl FIBB_GRP_WRITE);
  131.     FIBF_GRP_EXECUTE   = (1 shl FIBB_GRP_EXECUTE);
  132.     FIBF_GRP_DELETE    = (1 shl FIBB_GRP_DELETE);
  133.  
  134.     FIBF_SCRIPT         = 64;
  135.     FIBF_PURE           = 32;
  136.     FIBF_ARCHIVE        = 16;
  137.     FIBF_READ           = 8;
  138.     FIBF_WRITE          = 4;
  139.     FIBF_EXECUTE        = 2;
  140.     FIBF_DELETE         = 1;
  141.  
  142. {* Standard maximum length for an error string from fault.  However, most *}
  143. {* error strings should be kept under 60 characters if possible.  Don't   *}
  144. {* forget space for the header you pass in. *}
  145.  
  146.     FAULT_MAX  = 82;
  147.  
  148. {* All BCPL data must be long Integer aligned.  BCPL pointers are the long Integer
  149.  *  address (i.e byte address divided by 4 (>>2)) *}
  150.  
  151. {* BCPL strings have a length in the first byte and then the characters.
  152.  * For example:  s[0]=3 s[1]=S s[2]=Y s[3]=S                 *}
  153.  
  154.  
  155. Type
  156.  
  157. { returned by Info(), must be on a 4 byte boundary }
  158.  
  159.     pInfoData = ^tInfoData;
  160.     tInfoData = record
  161.         id_NumSoftErrors        : Longint;      { number of soft errors on disk }
  162.         id_UnitNumber           : Longint;      { Which unit disk is (was) mounted on }
  163.         id_DiskState            : Longint;      { See defines below }
  164.         id_NumBlocks            : Longint;      { Number of blocks on disk }
  165.         id_NumBlocksUsed        : Longint;      { Number of block in use }
  166.         id_BytesPerBlock        : Longint;
  167.         id_DiskType             : Longint;      { Disk Type code }
  168.         id_VolumeNode           : BPTR;         { BCPL pointer to volume node }
  169.         id_InUse                : Longint;      { Flag, zero if not in use }
  170.     end;
  171.  
  172. {$PACKRECORDS NORMAL}
  173.  
  174. Const
  175.  
  176. { ID stands for InfoData }
  177.  
  178.         { Disk states }
  179.  
  180.     ID_WRITE_PROTECTED  = 80;   { Disk is write protected }
  181.     ID_VALIDATING       = 81;   { Disk is currently being validated }
  182.     ID_VALIDATED        = 82;   { Disk is consistent and writeable }
  183.  
  184. CONST
  185.  ID_NO_DISK_PRESENT     = -1;
  186.  ID_UNREADABLE_DISK     = $42414400;   { 'BAD\0' }
  187.  ID_DOS_DISK            = $444F5300;   { 'DOS\0' }
  188.  ID_FFS_DISK            = $444F5301;   { 'DOS\1' }
  189.  ID_NOT_REALLY_DOS      = $4E444F53;   { 'NDOS'  }
  190.  ID_KICKSTART_DISK      = $4B49434B;   { 'KICK'  }
  191.  ID_MSDOS_DISK          = $4d534400;   { 'MSD\0' }
  192.  
  193. { Errors from IoErr(), etc. }
  194.  ERROR_NO_FREE_STORE              = 103;
  195.  ERROR_TASK_TABLE_FULL            = 105;
  196.  ERROR_BAD_TEMPLATE               = 114;
  197.  ERROR_BAD_NUMBER                 = 115;
  198.  ERROR_REQUIRED_ARG_MISSING       = 116;
  199.  ERROR_KEY_NEEDS_ARG              = 117;
  200.  ERROR_TOO_MANY_ARGS              = 118;
  201.  ERROR_UNMATCHED_QUOTES           = 119;
  202.  ERROR_LINE_TOO_LONG              = 120;
  203.  ERROR_FILE_NOT_OBJECT            = 121;
  204.  ERROR_INVALID_RESIDENT_LIBRARY   = 122;
  205.  ERROR_NO_DEFAULT_DIR             = 201;
  206.  ERROR_OBJECT_IN_USE              = 202;
  207.  ERROR_OBJECT_EXISTS              = 203;
  208.  ERROR_DIR_NOT_FOUND              = 204;
  209.  ERROR_OBJECT_NOT_FOUND           = 205;
  210.  ERROR_BAD_STREAM_NAME            = 206;
  211.  ERROR_OBJECT_TOO_LARGE           = 207;
  212.  ERROR_ACTION_NOT_KNOWN           = 209;
  213.  ERROR_INVALID_COMPONENT_NAME     = 210;
  214.  ERROR_INVALID_LOCK               = 211;
  215.  ERROR_OBJECT_WRONG_TYPE          = 212;
  216.  ERROR_DISK_NOT_VALIDATED         = 213;
  217.  ERROR_DISK_WRITE_PROTECTED       = 214;
  218.  ERROR_RENAME_ACROSS_DEVICES      = 215;
  219.  ERROR_DIRECTORY_NOT_EMPTY        = 216;
  220.  ERROR_TOO_MANY_LEVELS            = 217;
  221.  ERROR_DEVICE_NOT_MOUNTED         = 218;
  222.  ERROR_SEEK_ERROR                 = 219;
  223.  ERROR_COMMENT_TOO_BIG            = 220;
  224.  ERROR_DISK_FULL                  = 221;
  225.  ERROR_DELETE_PROTECTED           = 222;
  226.  ERROR_WRITE_PROTECTED            = 223;
  227.  ERROR_READ_PROTECTED             = 224;
  228.  ERROR_NOT_A_DOS_DISK             = 225;
  229.  ERROR_NO_DISK                    = 226;
  230.  ERROR_NO_MORE_ENTRIES            = 232;
  231. { added for 1.4 }
  232.  ERROR_IS_SOFT_LINK               = 233;
  233.  ERROR_OBJECT_LINKED              = 234;
  234.  ERROR_BAD_HUNK                   = 235;
  235.  ERROR_NOT_IMPLEMENTED            = 236;
  236.  ERROR_RECORD_NOT_LOCKED          = 240;
  237.  ERROR_LOCK_COLLISION             = 241;
  238.  ERROR_LOCK_TIMEOUT               = 242;
  239.  ERROR_UNLOCK_ERROR               = 243;
  240.  
  241. { error codes 303-305 are defined in dosasl.h }
  242.  
  243. { These are the return codes used by convention by AmigaDOS commands }
  244. { See FAILAT and IF for relvance to EXECUTE files                    }
  245.  RETURN_OK                        =   0;  { No problems, success }
  246.  RETURN_WARN                      =   5;  { A warning only }
  247.  RETURN_ERROR                     =  10;  { Something wrong }
  248.  RETURN_FAIL                      =  20;  { Complete or severe failure}
  249.  
  250. { Bit numbers that signal you that a user has issued a break }
  251.  SIGBREAKB_CTRL_C   = 12;
  252.  SIGBREAKB_CTRL_D   = 13;
  253.  SIGBREAKB_CTRL_E   = 14;
  254.  SIGBREAKB_CTRL_F   = 15;
  255.  
  256. { Bit fields that signal you that a user has issued a break }
  257. { for example:  if (SetSignal(0,0) & SIGBREAKF_CTRL_C) cleanup_and_exit(); }
  258.  SIGBREAKF_CTRL_C   = 4096;
  259.  SIGBREAKF_CTRL_D   = 8192;
  260.  SIGBREAKF_CTRL_E   = 16384;
  261.  SIGBREAKF_CTRL_F   = 32768;
  262.  
  263. { Values returned by SameLock() }
  264.  LOCK_SAME             =  0;
  265.  LOCK_SAME_HANDLER     =  1;       { actually same volume }
  266.  LOCK_DIFFERENT        =  -1;
  267.  
  268. { types for ChangeMode() }
  269.  CHANGE_LOCK    = 0;
  270.  CHANGE_FH      = 1;
  271.  
  272. { Values for MakeLink() }
  273.  LINK_HARD      = 0;
  274.  LINK_SOFT      = 1;       { softlinks are not fully supported yet }
  275.  
  276. { values returned by ReadItem }
  277.  ITEM_EQUAL     = -2;              { "=" Symbol }
  278.  ITEM_ERROR     = -1;              { error }
  279.  ITEM_NOTHING   = 0;               { *N, ;, endstreamch }
  280.  ITEM_UNQUOTED  = 1;               { unquoted item }
  281.  ITEM_QUOTED    = 2;               { quoted item }
  282.  
  283. { types for AllocDosObject/FreeDosObject }
  284.  DOS_FILEHANDLE        =  0;       { few people should use this }
  285.  DOS_EXALLCONTROL      =  1;       { Must be used to allocate this! }
  286.  DOS_FIB               =  2;       { useful }
  287.  DOS_STDPKT            =  3;       { for doing packet-level I/O }
  288.  DOS_CLI               =  4;       { for shell-writers, etc }
  289.  DOS_RDARGS            =  5;       { for ReadArgs if you pass it in }
  290.  
  291.  
  292. {
  293.  *      Data structures and equates used by the V1.4 DOS functions
  294.  * StrtoDate() and DatetoStr()
  295.  }
  296.  
  297. {--------- String/Date structures etc }
  298. Type
  299.        pDateTime = ^tDateTime;
  300.        tDateTime = record
  301.         dat_Stamp   : tDateStamp;      { DOS DateStamp }
  302.         dat_Format,                    { controls appearance of dat_StrDate }
  303.         dat_Flags   : Byte;           { see BITDEF's below }
  304.         dat_StrDay,                    { day of the week string }
  305.         dat_StrDate,                   { date string }
  306.         dat_StrTime : STRPTR;          { time string }
  307.        END;
  308.  
  309. { You need this much room for each of the DateTime strings: }
  310. CONST
  311.  LEN_DATSTRING =  16;
  312.  
  313. {      flags for dat_Flags }
  314.  
  315.  DTB_SUBST      = 0;               { substitute Today, Tomorrow, etc. }
  316.  DTF_SUBST      = 1;
  317.  DTB_FUTURE     = 1;               { day of the week is in future }
  318.  DTF_FUTURE     = 2;
  319.  
  320. {
  321.  *      date format values
  322.  }
  323.  
  324.  FORMAT_DOS     = 0;               { dd-mmm-yy }
  325.  FORMAT_INT     = 1;               { yy-mm-dd  }
  326.  FORMAT_USA     = 2;               { mm-dd-yy  }
  327.  FORMAT_CDN     = 3;               { dd-mm-yy  }
  328.  FORMAT_MAX     = FORMAT_CDN;
  329.  
  330.  
  331. {**********************************************************************
  332. ************************ PATTERN MATCHING ******************************
  333. ************************************************************************
  334.  
  335. * structure expected by MatchFirst, MatchNext.
  336. * Allocate this structure and initialize it as follows:
  337. *
  338. * Set ap_BreakBits to the signal bits (CDEF) that you want to take a
  339. * break on, or NULL, if you don't want to convenience the user.
  340. *
  341. * If you want to have the FULL PATH NAME of the files you found,
  342. * allocate a buffer at the END of this structure, and put the size of
  343. * it into ap_Strlen.  If you don't want the full path name, make sure
  344. * you set ap_Strlen to zero.  In this case, the name of the file, and stats
  345. * are available in the ap_Info, as per usual.
  346. *
  347. * Then call MatchFirst() and then afterwards, MatchNext() with this structure.
  348. * You should check the return value each time (see below) and take the
  349. * appropriate action, ultimately calling MatchEnd() when there are
  350. * no more files and you are done.  You can tell when you are done by
  351. * checking for the normal AmigaDOS return code ERROR_NO_MORE_ENTRIES.
  352. *
  353. }
  354.  
  355. Type
  356.        pAChain = ^tAChain;
  357.        tAChain = record
  358.         an_Child,
  359.         an_Parent   : pAChain;
  360.         an_Lock     : BPTR;
  361.         an_Info     : tFileInfoBlock;
  362.         an_Flags    : Shortint;
  363.         an_String   : Array[0..0] of Char;   { FIX!! }
  364.        END;
  365.  
  366.        pAnchorPath = ^tAnchorPath;
  367.        tAnchorPath = record
  368.         case integer of
  369.         0 : (
  370.         ap_First      : pAChain;
  371.         ap_Last       : pAChain;
  372.         );
  373.         1 : (
  374.         ap_Base,                    { pointer to first anchor }
  375.         ap_Current    : pAChain;    { pointer to last anchor }
  376.         ap_BreakBits,               { Bits we want to break on }
  377.         ap_FoundBreak : Longint;    { Bits we broke on. Also returns ERROR_BREAK }
  378.         ap_Flags      : Shortint;       { New use for extra Integer. }
  379.         ap_Reserved   : Shortint;
  380.         ap_Strlen     : Integer;       { This is what ap_Length used to be }
  381.         ap_Info       : tFileInfoBlock;
  382.         ap_Buf        : Array[0..0] of Char;     { Buffer for path name, allocated by user !! }
  383.         { FIX! }
  384.         );
  385.        END;
  386.  
  387.  
  388. CONST
  389.     APB_DOWILD    =  0;       { User option ALL }
  390.     APF_DOWILD    =  1;
  391.  
  392.     APB_ITSWILD   =  1;       { Set by MatchFirst, used by MatchNext  }
  393.     APF_ITSWILD   =  2;       { Application can test APB_ITSWILD, too }
  394.                                 { (means that there's a wildcard        }
  395.                                 { in the pattern after calling          }
  396.                                 { MatchFirst).                          }
  397.  
  398.     APB_DODIR     =  2;       { Bit is SET IF a DIR node should be }
  399.     APF_DODIR     =  4;       { entered. Application can RESET this }
  400.                                 { bit after MatchFirst/MatchNext to AVOID }
  401.                                 { entering a dir. }
  402.  
  403.     APB_DIDDIR    =  3;       { Bit is SET for an "expired" dir node. }
  404.     APF_DIDDIR    =  8;
  405.  
  406.     APB_NOMEMERR  =  4;       { Set on memory error }
  407.     APF_NOMEMERR  =  16;
  408.  
  409.     APB_DODOT     =  5;       { IF set, allow conversion of '.' to }
  410.     APF_DODOT     =  32;      { CurrentDir }
  411.  
  412.     APB_DirChanged  = 6;       { ap_Current->an_Lock changed }
  413.     APF_DirChanged  = 64;      { since last MatchNext call }
  414.  
  415.  
  416.     DDB_PatternBit  = 0;
  417.     DDF_PatternBit  = 1;
  418.     DDB_ExaminedBit = 1;
  419.     DDF_ExaminedBit = 2;
  420.     DDB_Completed   = 2;
  421.     DDF_Completed   = 4;
  422.     DDB_AllBit      = 3;
  423.     DDF_AllBit      = 8;
  424.     DDB_Single      = 4;
  425.     DDF_Single      = 16;
  426.  
  427. {
  428.  * Constants used by wildcard routines, these are the pre-parsed tokens
  429.  * referred to by pattern match.  It is not necessary for you to do
  430.  * anything about these, MatchFirst() MatchNext() handle all these for you.
  431.  }
  432.  
  433.     P_ANY         =  $80;    { Token for '*' or '#?  }
  434.     P_SINGLE      =  $81;    { Token for '?' }
  435.     P_ORSTART     =  $82;    { Token for '(' }
  436.     P_ORNEXT      =  $83;    { Token for '|' }
  437.     P_OREND       =  $84;    { Token for ')' }
  438.     P_NOT         =  $85;    { Token for '~' }
  439.     P_NOTEND      =  $86;    { Token for }
  440.     P_NOTCLASS    =  $87;    { Token for '^' }
  441.     P_CLASS       =  $88;    { Token for '[]' }
  442.     P_REPBEG      =  $89;    { Token for '[' }
  443.     P_REPEND      =  $8A;    { Token for ']' }
  444.     P_STOP        =  $8B;    { token to force end of evaluation }
  445.  
  446. { Values for an_Status, NOTE: These are the actual bit numbers }
  447.  
  448.     COMPLEX_BIT   =  1;       { Parsing complex pattern }
  449.     EXAMINE_BIT   =  2;       { Searching directory }
  450.  
  451. {
  452.  * Returns from MatchFirst(), MatchNext()
  453.  * You can also get dos error returns, such as ERROR_NO_MORE_ENTRIES,
  454.  * these are in the dos.h file.
  455.  }
  456.  
  457.     ERROR_BUFFER_OVERFLOW  = 303;     { User OR internal buffer overflow }
  458.     ERROR_BREAK            = 304;     { A break character was received }
  459.     ERROR_NOT_EXECUTABLE   = 305;     { A file has E bit cleared }
  460.  
  461. {   hunk types }
  462.      HUNK_UNIT      = 999 ;
  463.      HUNK_NAME      = 1000;
  464.      HUNK_CODE      = 1001;
  465.      HUNK_DATA      = 1002;
  466.      HUNK_BSS       = 1003;
  467.      HUNK_RELOC32   = 1004;
  468.      HUNK_RELOC16   = 1005;
  469.      HUNK_RELOC8    = 1006;
  470.      HUNK_EXT       = 1007;
  471.      HUNK_SYMBOL    = 1008;
  472.      HUNK_DEBUG     = 1009;
  473.      HUNK_END       = 1010;
  474.      HUNK_HEADER    = 1011;
  475.  
  476.      HUNK_OVERLAY   = 1013;
  477.      HUNK_BREAK     = 1014;
  478.  
  479.      HUNK_DREL32    = 1015;
  480.      HUNK_DREL16    = 1016;
  481.      HUNK_DREL8     = 1017;
  482.  
  483.      HUNK_LIB       = 1018;
  484.      HUNK_INDEX     = 1019;
  485.  
  486. {   hunk_ext sub-types }
  487.      EXT_SYMB       = 0  ;     {   symbol table }
  488.      EXT_DEF        = 1  ;     {   relocatable definition }
  489.      EXT_ABS        = 2  ;     {   Absolute definition }
  490.      EXT_RES        = 3  ;     {   no longer supported }
  491.      EXT_REF32      = 129;     {   32 bit reference to symbol }
  492.      EXT_COMMON     = 130;     {   32 bit reference to COMMON block }
  493.      EXT_REF16      = 131;     {   16 bit reference to symbol }
  494.      EXT_REF8       = 132;     {    8 bit reference to symbol }
  495.      EXT_DEXT32     = 133;     {   32 bit data releative reference }
  496.      EXT_DEXT16     = 134;     {   16 bit data releative reference }
  497.      EXT_DEXT8      = 135;     {    8 bit data releative reference }
  498.  
  499.  
  500. Type
  501.  
  502. { All DOS processes have this structure }
  503. { Create and Device Proc returns pointer to the MsgPort in this structure }
  504. { dev_proc = Address(Integer(DeviceProc()) - SizeOf(Task)) }
  505.  
  506.     pProcess = ^tProcess;
  507.     tProcess = record
  508.         pr_Task         : tTask;
  509.         pr_MsgPort      : tMsgPort;     { This is BPTR address from DOS functions  }
  510.         pr_Pad          : Integer;         { Remaining variables on 4 byte boundaries }
  511.         pr_SegList      : BPTR;         { Array of seg lists used by this process  }
  512.         pr_StackSize    : Longint;      { Size of process stack in bytes            }
  513.         pr_GlobVec      : Pointer;      { Global vector for this process (BCPL)    }
  514.         pr_TaskNum      : Longint;      { CLI task number of zero if not a CLI      }
  515.         pr_StackBase    : BPTR;         { Ptr to high memory end of process stack  }
  516.         pr_Result2      : Longint;      { Value of secondary result from last call }
  517.         pr_CurrentDir   : BPTR;         { Lock associated with current directory   }
  518.         pr_CIS          : BPTR;         { Current CLI Input Stream                  }
  519.         pr_COS          : BPTR;         { Current CLI Output Stream                 }
  520.         pr_ConsoleTask  : Pointer;      { Console handler process for current window}
  521.         pr_FileSystemTask : Pointer;    { File handler process for current drive   }
  522.         pr_CLI          : BPTR;         { pointer to ConsoleLineInterpreter         }
  523.         pr_ReturnAddr   : Pointer;      { pointer to previous stack frame           }
  524.         pr_PktWait      : Pointer;      { Function to be called when awaiting msg  }
  525.         pr_WindowPtr    : Pointer;      { Window for error printing }
  526.         { following definitions are new with 2.0 }
  527.         pr_HomeDir      : BPTR;         { Home directory of executing program      }
  528.         pr_Flags        : Longint;      { flags telling dos about process          }
  529.         pr_ExitCode     : Pointer;      { code to call on exit of program OR NULL  }
  530.         pr_ExitData     : Longint;      { Passed as an argument to pr_ExitCode.    }
  531.         pr_Arguments    : STRPTR;       { Arguments passed to the process at start }
  532.         pr_LocalVars    : tMinList;      { Local environment variables             }
  533.         pr_ShellPrivate : ULONG;        { for the use of the current shell         }
  534.         pr_CES          : BPTR;         { Error stream - IF NULL, use pr_COS       }
  535.     end;
  536.  
  537. {
  538.  * Flags for pr_Flags
  539.  }
  540. CONST
  541.  PRB_FREESEGLIST       =  0 ;
  542.  PRF_FREESEGLIST       =  1 ;
  543.  PRB_FREECURRDIR       =  1 ;
  544.  PRF_FREECURRDIR       =  2 ;
  545.  PRB_FREECLI           =  2 ;
  546.  PRF_FREECLI           =  4 ;
  547.  PRB_CLOSEINPUT        =  3 ;
  548.  PRF_CLOSEINPUT        =  8 ;
  549.  PRB_CLOSEOUTPUT       =  4 ;
  550.  PRF_CLOSEOUTPUT       =  16;
  551.  PRB_FREEARGS          =  5 ;
  552.  PRF_FREEARGS          =  32;
  553.  
  554.  
  555. { The long Integer address (BPTR) of this structure is returned by
  556.  * Open() and other routines that return a file.  You need only worry
  557.  * about this struct to do async io's via PutMsg() instead of
  558.  * standard file system calls }
  559.  
  560. Type
  561.  
  562.     pFileHandle = ^tFileHandle;
  563.     tFileHandle = record
  564.         fh_Link         : pMessage;   { EXEC message        }
  565.         fh_Port         : pMsgPort;   { Reply port for the packet }
  566.         fh_Type         : pMsgPort;   { Port to do PutMsg() to
  567.                                           Address is negative if a plain file }
  568.         fh_Buf          : Longint;
  569.         fh_Pos          : Longint;
  570.         fh_End          : Longint;
  571.         fh_Func1        : Longint;
  572.         fh_Func2        : Longint;
  573.         fh_Func3        : Longint;
  574.         fh_Arg1         : Longint;
  575.         fh_Arg2         : Longint;
  576.     end;
  577.  
  578. { This is the extension to EXEC Messages used by DOS }
  579.  
  580.     pDosPacket = ^tDosPacket;
  581.     tDosPacket = record
  582.         dp_Link : pMessage;     { EXEC message        }
  583.         dp_Port : pMsgPort;     { Reply port for the packet }
  584.                                 { Must be filled in each send. }
  585.         case integer of
  586.         0 : (
  587.         dp_Action : Longint;
  588.         dp_Status : Longint;
  589.         dp_Status2 : Longint;
  590.         dp_BufAddr : Longint;
  591.         );
  592.         1 : (
  593.         dp_Type : Longint;      { See ACTION_... below and
  594.                                 * 'R' means Read, 'W' means Write to the
  595.                                 * file system }
  596.         dp_Res1 : Longint;      { For file system calls this is the result
  597.                                 * that would have been returned by the
  598.                                 * function, e.g. Write ('W') returns actual
  599.                                 * length written }
  600.         dp_Res2 : Longint;      { For file system calls this is what would
  601.                                 * have been returned by IoErr() }
  602.         dp_Arg1 : Longint;
  603.         dp_Arg2 : Longint;
  604.         dp_Arg3 : Longint;
  605.         dp_Arg4 : Longint;
  606.         dp_Arg5 : Longint;
  607.         dp_Arg6 : Longint;
  608.         dp_Arg7 : Longint;
  609.         );
  610.     end;
  611.  
  612.  
  613. { A Packet does not require the Message to be before it in memory, but
  614.  * for convenience it is useful to associate the two.
  615.  * Also see the function init_std_pkt for initializing this structure }
  616.  
  617.     pStandardPacket = ^tStandardPacket;
  618.     tStandardPacket = record
  619.         sp_Msg          : tMessage;
  620.         sp_Pkt          : tDosPacket;
  621.     end;
  622.  
  623.  
  624. Const
  625.  
  626. { Packet types }
  627.     ACTION_NIL                  = 0;
  628.     ACTION_GET_BLOCK            = 2;    { OBSOLETE }
  629.     ACTION_SET_MAP              = 4;
  630.     ACTION_DIE                  = 5;
  631.     ACTION_EVENT                = 6;
  632.     ACTION_CURRENT_VOLUME       = 7;
  633.     ACTION_LOCATE_OBJECT        = 8;
  634.     ACTION_RENAME_DISK          = 9;
  635.     ACTION_WRITE                = $57;  { 'W' }
  636.     ACTION_READ                 = $52;  { 'R' }
  637.     ACTION_FREE_LOCK            = 15;
  638.     ACTION_DELETE_OBJECT        = 16;
  639.     ACTION_RENAME_OBJECT        = 17;
  640.     ACTION_MORE_CACHE           = 18;
  641.     ACTION_COPY_DIR             = 19;
  642.     ACTION_WAIT_CHAR            = 20;
  643.     ACTION_SET_PROTECT          = 21;
  644.     ACTION_CREATE_DIR           = 22;
  645.     ACTION_EXAMINE_OBJECT       = 23;
  646.     ACTION_EXAMINE_NEXT         = 24;
  647.     ACTION_DISK_INFO            = 25;
  648.     ACTION_INFO                 = 26;
  649.     ACTION_FLUSH                = 27;
  650.     ACTION_SET_COMMENT          = 28;
  651.     ACTION_PARENT               = 29;
  652.     ACTION_TIMER                = 30;
  653.     ACTION_INHIBIT              = 31;
  654.     ACTION_DISK_TYPE            = 32;
  655.     ACTION_DISK_CHANGE          = 33;
  656.     ACTION_SET_DATE             = 34;
  657.  
  658.     ACTION_SCREEN_MODE          = 994;
  659.  
  660.     ACTION_READ_RETURN          = 1001;
  661.     ACTION_WRITE_RETURN         = 1002;
  662.     ACTION_SEEK                 = 1008;
  663.     ACTION_FINDUPDATE           = 1004;
  664.     ACTION_FINDINPUT            = 1005;
  665.     ACTION_FINDOUTPUT           = 1006;
  666.     ACTION_END                  = 1007;
  667.     ACTION_TRUNCATE             = 1022; { fast file system only }
  668.     ACTION_WRITE_PROTECT        = 1023; { fast file system only }
  669.  
  670. { new 2.0 packets }
  671.     ACTION_SAME_LOCK       = 40;
  672.     ACTION_CHANGE_SIGNAL   = 995;
  673.     ACTION_FORMAT          = 1020;
  674.     ACTION_MAKE_LINK       = 1021;
  675. {}
  676. {}
  677.     ACTION_READ_LINK       = 1024;
  678.     ACTION_FH_FROM_LOCK    = 1026;
  679.     ACTION_IS_FILESYSTEM   = 1027;
  680.     ACTION_CHANGE_MODE     = 1028;
  681. {}
  682.     ACTION_COPY_DIR_FH     = 1030;
  683.     ACTION_PARENT_FH       = 1031;
  684.     ACTION_EXAMINE_ALL     = 1033;
  685.     ACTION_EXAMINE_FH      = 1034;
  686.  
  687.     ACTION_LOCK_RECORD     = 2008;
  688.     ACTION_FREE_RECORD     = 2009;
  689.  
  690.     ACTION_ADD_NOTIFY      = 4097;
  691.     ACTION_REMOVE_NOTIFY   = 4098;
  692.  
  693.     {* Added in V39: *}
  694.     ACTION_EXAMINE_ALL_END  = 1035;
  695.     ACTION_SET_OWNER        = 1036;
  696.  
  697. {* Tell a file system to serialize the current volume. This is typically
  698.  * done by changing the creation date of the disk. This packet does not take
  699.  * any arguments.  NOTE: be prepared to handle failure of this packet for
  700.  * V37 ROM filesystems.
  701.  *}
  702.  
  703.     ACTION_SERIALIZE_DISK  = 4200;
  704.  
  705. {
  706.  * A structure for holding error messages - stored as array with error == 0
  707.  * for the last entry.
  708.  }
  709. Type
  710.        pErrorString = ^tErrorString;
  711.        tErrorString = record
  712.         estr_Nums     : Pointer;
  713.         estr_Strings  : Pointer;
  714.        END;
  715.  
  716.  
  717. { DOS library node structure.
  718.  * This is the data at positive offsets from the library node.
  719.  * Negative offsets from the node is the jump table to DOS functions
  720.  * node = (struct DosLibrary *) OpenLibrary( "dos.library" .. )      }
  721.  
  722. Type
  723.  
  724.     pDosLibrary = ^tDosLibrary;
  725.     tDosLibrary = record
  726.         dl_lib          : tLibrary;
  727.         dl_Root         : Pointer;      { Pointer to RootNode, described below }
  728.         dl_GV           : Pointer;      { Pointer to BCPL global vector       }
  729.         dl_A2           : Longint;      { Private register dump of DOS        }
  730.         dl_A5           : Longint;
  731.         dl_A6           : Longint;
  732.         dl_Errors       : pErrorString; { pointer to array of error msgs }
  733.         dl_TimeReq      : pTimeRequest; { private pointer to timer request }
  734.         dl_UtilityBase  : pLibrary;     { private ptr to utility library }
  735.         dl_IntuitionBase : pLibrary;
  736.     end;
  737.  
  738.     pRootNode = ^tRootNode;
  739.     tRootNode = record
  740.         rn_TaskArray    : BPTR;         { [0] is max number of CLI's
  741.                                           [1] is APTR to process id of CLI 1
  742.                                           [n] is APTR to process id of CLI n }
  743.         rn_ConsoleSegment : BPTR;       { SegList for the CLI }
  744.         rn_Time          : tDateStamp;  { Current time }
  745.         rn_RestartSeg   : Longint;      { SegList for the disk validator process }
  746.         rn_Info         : BPTR;         { Pointer ot the Info structure }
  747.         rn_FileHandlerSegment : BPTR;   { segment for a file handler }
  748.         rn_CliList      : tMinList;     { new list of all CLI processes }
  749.                                         { the first cpl_Array is also rn_TaskArray }
  750.         rn_BootProc     : pMsgPort;     { private ptr to msgport of boot fs      }
  751.         rn_ShellSegment : BPTR;         { seglist for Shell (for NewShell)         }
  752.         rn_Flags        : Longint;      { dos flags }
  753.     end;
  754.  
  755. CONST
  756.  RNB_WILDSTAR   = 24;
  757.  RNF_WILDSTAR   = 16777216;
  758.  RNB_PRIVATE1   = 1;       { private for dos }
  759.  RNF_PRIVATE1   = 2;
  760.  
  761. Type
  762.     pDosInfo = ^tDosInfo;
  763.     tDosInfo = record
  764.         case integer of
  765.         0 : (
  766.         di_ResList : BPTR;
  767.         );
  768.         1 : (
  769.         di_McName       : BPTR;          { Network name of this machine; currently 0 }
  770.         di_DevInfo      : BPTR;          { Device List }
  771.         di_Devices      : BPTR;          { Currently zero }
  772.         di_Handlers     : BPTR;          { Currently zero }
  773.         di_NetHand      : Pointer;       { Network handler processid; currently zero }
  774.         di_DevLock,                      { do NOT access directly! }
  775.         di_EntryLock,                    { do NOT access directly! }
  776.         di_DeleteLock   : tSignalSemaphore; { do NOT access directly! }
  777.         );
  778.     end;
  779.  
  780. { ONLY to be allocated by DOS! }
  781.  
  782.        pCliProcList = ^tCliProcList;
  783.        tCliProcList = record
  784.         cpl_Node   : tMinNode;
  785.         cpl_First  : Longint;      { number of first entry in array }
  786.         cpl_Array  : Array[0..0] of pMsgPort;
  787.                              { [0] is max number of CLI's in this entry (n)
  788.                               * [1] is CPTR to process id of CLI cpl_First
  789.                               * [n] is CPTR to process id of CLI cpl_First+n-1
  790.                               }
  791.        END;
  792.  
  793. { structure for the Dos resident list.  Do NOT allocate these, use       }
  794. { AddSegment(), and heed the warnings in the autodocs!                   }
  795.  
  796. Type
  797.        pSegment = ^tSegment;
  798.        tSegment = record
  799.         seg_Next  : BPTR;
  800.         seg_UC    : Longint;
  801.         seg_Seg   : BPTR;
  802.         seg_Name  : Array[0..3] of Char;      { actually the first 4 chars of BSTR name }
  803.        END;
  804.  
  805. CONST
  806.  CMD_SYSTEM    =  -1;
  807.  CMD_INTERNAL  =  -2;
  808.  CMD_DISABLED  =  -999;
  809.  
  810.  
  811. { DOS Processes started from the CLI via RUN or NEWCLI have this additional
  812.  * set to data associated with them }
  813. Type
  814.     pCommandLineInterface = ^tCommandLineInterface;
  815.     tCommandLineInterface = record
  816.         cli_Result2        : Longint;      { Value of IoErr from last command }
  817.         cli_SetName        : BSTR;         { Name of current directory }
  818.         cli_CommandDir     : BPTR;         { Lock associated with command directory }
  819.         cli_ReturnCode     : Longint;      { Return code from last command }
  820.         cli_CommandName    : BSTR;         { Name of current command }
  821.         cli_FailLevel      : Longint;      { Fail level (set by FAILAT) }
  822.         cli_Prompt         : BSTR;         { Current prompt (set by PROMPT) }
  823.         cli_StandardInput  : BPTR;         { Default (terminal) CLI input }
  824.         cli_CurrentInput   : BPTR;         { Current CLI input }
  825.         cli_CommandFile    : BSTR;         { Name of EXECUTE command file }
  826.         cli_Interactive    : Longint;      { Boolean; True if prompts required }
  827.         cli_Background     : Longint;      { Boolean; True if CLI created by RUN }
  828.         cli_CurrentOutput  : BPTR;         { Current CLI output }
  829.         cli_DefaultStack   : Longint;      { Stack size to be obtained in long words }
  830.         cli_StandardOutput : BPTR;         { Default (terminal) CLI output }
  831.         cli_Module         : BPTR;         { SegList of currently loaded command }
  832.     end;
  833.  
  834. { This structure can take on different values depending on whether it is
  835.  * a device, an assigned directory, or a volume.  Below is the structure
  836.  * reflecting volumes only.  Following that is the structure representing
  837.  * only devices.
  838.  }
  839.  
  840. { structure representing a volume }
  841.  
  842.     pDeviceList = ^tDeviceList;
  843.     tDeviceList = record
  844.         dl_Next         : BPTR;         { bptr to next device list }
  845.         dl_Type         : Longint;      { see DLT below }
  846.         dl_Task         : pMsgPort;     { ptr to handler task }
  847.         dl_Lock         : BPTR;         { not for volumes }
  848.         dl_VolumeDate   : tDateStamp;   { creation date }
  849.         dl_LockList     : BPTR;         { outstanding locks }
  850.         dl_DiskType     : Longint;      { 'DOS', etc }
  851.         dl_unused       : Longint;
  852.         dl_Name         : BSTR;         { bptr to bcpl name }
  853.     end;
  854.  
  855. { device structure (same as the DeviceNode structure in filehandler.h) }
  856.  
  857.     pDevInfo = ^tDevInfo;
  858.     tDevInfo = record
  859.         dvi_Next        : BPTR;
  860.         dvi_Type        : Longint;
  861.         dvi_Task        : Pointer;
  862.         dvi_Lock        : BPTR;
  863.         dvi_Handler     : BSTR;
  864.         dvi_StackSize   : Longint;
  865.         dvi_Priority    : Longint;
  866.         dvi_Startup     : Longint;
  867.         dvi_SegList     : BPTR;
  868.         dvi_GlobVec     : BSTR;
  869.         dvi_Name        : BSTR;
  870.     end;
  871.  
  872. {    structure used for multi-directory assigns. AllocVec()ed. }
  873.  
  874.        pAssignList = ^tAssignList;
  875.        tAssignList = record
  876.         al_Next : pAssignList;
  877.         al_Lock : BPTR;
  878.        END;
  879.  
  880.  
  881. { combined structure for devices, assigned directories, volumes }
  882.  
  883.    pDosList = ^tDosList;
  884.    tDosList = record
  885.     dol_Next            : BPTR;           {    bptr to next device on list }
  886.     dol_Type            : Longint;        {    see DLT below }
  887.     dol_Task            : pMsgPort;       {    ptr to handler task }
  888.     dol_Lock            : BPTR;
  889.     case integer of
  890.     0 : (
  891.         dol_Handler : record
  892.           dol_Handler    : BSTR;      {    file name to load IF seglist is null }
  893.           dol_StackSize,              {    stacksize to use when starting process }
  894.           dol_Priority,               {    task priority when starting process }
  895.           dol_Startup    : Longint;   {    startup msg: FileSysStartupMsg for disks }
  896.           dol_SegList,                {    already loaded code for new task }
  897.           dol_GlobVec    : BPTR;      {    BCPL global vector to use when starting
  898.                                  * a process. -1 indicates a C/Assembler
  899.                                  * program. }
  900.         end;
  901.     );
  902.     1 : (
  903.         dol_Volume       : record
  904.           dol_VolumeDate : tDateStamp; {    creation date }
  905.           dol_LockList   : BPTR;       {    outstanding locks }
  906.           dol_DiskType   : Longint;    {    'DOS', etc }
  907.         END;
  908.     );
  909.     2 : (
  910.         dol_assign       :  record
  911.           dol_AssignName : STRPTR;        {    name for non-OR-late-binding assign }
  912.           dol_List       : pAssignList;   {    for multi-directory assigns (regular) }
  913.         END;
  914.     dol_Name            : BSTR;           {    bptr to bcpl name }
  915.     );
  916.    END;
  917.  
  918. Const
  919.  
  920. { definitions for dl_Type }
  921.  
  922.     DLT_DEVICE          = 0;
  923.     DLT_DIRECTORY       = 1;
  924.     DLT_VOLUME          = 2;
  925.     DLT_LATE            = 3;       {    late-binding assign }
  926.     DLT_NONBINDING      = 4;       {    non-binding assign }
  927.     DLT_PRIVATE         = -1;      {    for internal use only }
  928.  
  929. {    structure return by GetDeviceProc() }
  930. Type
  931.  
  932.        pDevProc = ^tDevProc;
  933.        tDevProc = record
  934.         dvp_Port        : pMsgPort;
  935.         dvp_Lock        : BPTR;
  936.         dvp_Flags       : Longint;
  937.         dvp_DevNode     : pDosList;    {    DON'T TOUCH OR USE! }
  938.        END;
  939.  
  940. CONST
  941. {    definitions for dvp_Flags }
  942.      DVPB_UNLOCK   =  0;
  943.      DVPF_UNLOCK   =  1;
  944.      DVPB_ASSIGN   =  1;
  945.      DVPF_ASSIGN   =  2;
  946.  
  947. {    Flags to be passed to LockDosList(), etc }
  948.      LDB_DEVICES   =  2;
  949.      LDF_DEVICES   =  4;
  950.      LDB_VOLUMES   =  3;
  951.      LDF_VOLUMES   =  8;
  952.      LDB_ASSIGNS   =  4;
  953.      LDF_ASSIGNS   =  16;
  954.      LDB_ENTRY     =  5;
  955.      LDF_ENTRY     =  32;
  956.      LDB_DELETE    =  6;
  957.      LDF_DELETE    =  64;
  958.  
  959. {    you MUST specify one of LDF_READ or LDF_WRITE }
  960.      LDB_READ      =  0;
  961.      LDF_READ      =  1;
  962.      LDB_WRITE     =  1;
  963.      LDF_WRITE     =  2;
  964.  
  965. {    actually all but LDF_ENTRY (which is used for internal locking) }
  966.      LDF_ALL       =  (LDF_DEVICES+LDF_VOLUMES+LDF_ASSIGNS);
  967.  
  968. {    error report types for ErrorReport() }
  969.      REPORT_STREAM          = 0;       {    a stream }
  970.      REPORT_TASK            = 1;       {    a process - unused }
  971.      REPORT_LOCK            = 2;       {    a lock }
  972.      REPORT_VOLUME          = 3;       {    a volume node }
  973.      REPORT_INSERT          = 4;       {    please insert volume }
  974.  
  975. {    Special error codes for ErrorReport() }
  976.      ABORT_DISK_ERROR       = 296;     {    Read/write error }
  977.      ABORT_BUSY             = 288;     {    You MUST replace... }
  978.  
  979. {    types for initial packets to shells from run/newcli/execute/system. }
  980. {    For shell-writers only }
  981.      RUN_EXECUTE           =  -1;
  982.      RUN_SYSTEM            =  -2;
  983.      RUN_SYSTEM_ASYNCH     =  -3;
  984.  
  985. {    Types for fib_DirEntryType.  NOTE that both USERDIR and ROOT are      }
  986. {    directories, and that directory/file checks should use <0 and >=0.    }
  987. {    This is not necessarily exhaustive!  Some handlers may use other      }
  988. {    values as needed, though <0 and >=0 should remain as supported as     }
  989. {    possible.                                                             }
  990.      ST_ROOT       =  1 ;
  991.      ST_USERDIR    =  2 ;
  992.      ST_SOFTLINK   =  3 ;      {    looks like dir, but may point to a file! }
  993.      ST_LINKDIR    =  4 ;      {    hard link to dir }
  994.      ST_FILE       =  -3;      {    must be negative for FIB! }
  995.      ST_LINKFILE   =  -4;      {    hard link to file }
  996.      ST_PIPEFILE   =  -5;      {    for pipes that support ExamineFH   }
  997.  
  998. Type
  999.  
  1000. { a lock structure, as returned by Lock() or DupLock() }
  1001.  
  1002.     pFileLock = ^tFileLock;
  1003.     tFileLock = record
  1004.         fl_Link         : BPTR;         { bcpl pointer to next lock }
  1005.         fl_Key          : Longint;      { disk block number }
  1006.         fl_Access       : Longint;      { exclusive or shared }
  1007.         fl_Task         : pMsgPort;     { handler task's port }
  1008.         fl_Volume       : BPTR;         { bptr to a DeviceList }
  1009.     end;
  1010.  
  1011.  
  1012. {  NOTE: V37 dos.library, when doing ExAll() emulation, and V37 filesystems  }
  1013. {  will return an error if passed ED_OWNER.  If you get ERROR_BAD_NUMBER,    }
  1014. {  retry with ED_COMMENT to get everything but owner info.  All filesystems  }
  1015. {  supporting ExAll() must support through ED_COMMENT, and must check Type   }
  1016. {  and return ERROR_BAD_NUMBER if they don't support the type.               }
  1017.  
  1018. {   values that can be passed for what data you want from ExAll() }
  1019. {   each higher value includes those below it (numerically)       }
  1020. {   you MUST chose one of these values }
  1021. CONST
  1022.      ED_NAME        = 1;
  1023.      ED_TYPE        = 2;
  1024.      ED_SIZE        = 3;
  1025.      ED_PROTECTION  = 4;
  1026.      ED_DATE        = 5;
  1027.      ED_COMMENT     = 6;
  1028.      ED_OWNER       = 7;
  1029. {
  1030.  *   Structure in which exall results are returned in.  Note that only the
  1031.  *   fields asked for will exist!
  1032.  }
  1033. Type
  1034.        pExAllData = ^tExAllData;
  1035.        tExAllData = record
  1036.         ed_Next     : pExAllData;
  1037.         ed_Name     : STRPTR;
  1038.         ed_Type,
  1039.         ed_Size,
  1040.         ed_Prot,
  1041.         ed_Days,
  1042.         ed_Mins,
  1043.         ed_Ticks    : ULONG;
  1044.         ed_Comment  : STRPTR;     {   strings will be after last used field }
  1045.         ed_OwnerUID,              { new for V39 }
  1046.         ed_OwnerGID : Word;
  1047.        END;
  1048.  
  1049. {
  1050.  *   Control structure passed to ExAll.  Unused fields MUST be initialized to
  1051.  *   0, expecially eac_LastKey.
  1052.  *
  1053.  *   eac_MatchFunc is a hook (see utility.library documentation for usage)
  1054.  *   It should return true if the entry is to returned, false if it is to be
  1055.  *   ignored.
  1056.  *
  1057.  *   This structure MUST be allocated by AllocDosObject()!
  1058.  }
  1059.  
  1060.        pExAllControl = ^tExAllControl;
  1061.        tExAllControl = record
  1062.         eac_Entries,                 {   number of entries returned in buffer      }
  1063.         eac_LastKey     : ULONG;     {   Don't touch inbetween linked ExAll calls! }
  1064.         eac_MatchString : STRPTR;    {   wildcard string for pattern match OR NULL }
  1065.         eac_MatchFunc   : pHook;     {   optional private wildcard FUNCTION     }
  1066.        END;
  1067.  
  1068.  
  1069.  
  1070. { The disk "environment" is a longword array that describes the
  1071.  * disk geometry.  It is variable sized, with the length at the beginning.
  1072.  * Here are the constants for a standard geometry.
  1073. }
  1074.  
  1075. Type
  1076.  
  1077.     pDosEnvec = ^tDosEnvec;
  1078.     tDosEnvec = record
  1079.         de_TableSize      : ULONG;      { Size of Environment vector }
  1080.         de_SizeBlock      : ULONG;      { in longwords: standard value is 128 }
  1081.         de_SecOrg         : ULONG;      { not used; must be 0 }
  1082.         de_Surfaces       : ULONG;      { # of heads (surfaces). drive specific }
  1083.         de_SectorPerBlock : ULONG;      { not used; must be 1 }
  1084.         de_BlocksPerTrack : ULONG;      { blocks per track. drive specific }
  1085.         de_Reserved       : ULONG;      { DOS reserved blocks at start of partition. }
  1086.         de_PreAlloc       : ULONG;      { DOS reserved blocks at end of partition }
  1087.         de_Interleave     : ULONG;      { usually 0 }
  1088.         de_LowCyl         : ULONG;      { starting cylinder. typically 0 }
  1089.         de_HighCyl        : ULONG;      { max cylinder. drive specific }
  1090.         de_NumBuffers     : ULONG;      { Initial # DOS of buffers.  }
  1091.         de_BufMemType     : ULONG;      { type of mem to allocate for buffers }
  1092.         de_MaxTransfer    : ULONG;      { Max number of bytes to transfer at a time }
  1093.         de_Mask           : ULONG;      { Address Mask to block out certain memory }
  1094.         de_BootPri        : Longint;    { Boot priority for autoboot }
  1095.         de_DosType        : ULONG;      { ASCII (HEX) string showing filesystem type;
  1096.                                         * 0X444F5300 is old filesystem,
  1097.                                         * 0X444F5301 is fast file system }
  1098.         de_Baud           : ULONG;      {     Baud rate for serial handler }
  1099.         de_Control        : ULONG;      {     Control Integer for handler/filesystem }
  1100.         de_BootBlocks     : ULONG;      {     Number of blocks containing boot code }
  1101.     end;
  1102.  
  1103. Const
  1104.  
  1105. { these are the offsets into the array }
  1106.  
  1107.     DE_TABLESIZE        = 0;    { standard value is 11 }
  1108.     DE_SIZEBLOCK        = 1;    { in longwords: standard value is 128 }
  1109.     DE_SECORG           = 2;    { not used; must be 0 }
  1110.     DE_NUMHEADS         = 3;    { # of heads (surfaces). drive specific }
  1111.     DE_SECSPERBLK       = 4;    { not used; must be 1 }
  1112.     DE_BLKSPERTRACK     = 5;    { blocks per track. drive specific }
  1113.     DE_RESERVEDBLKS     = 6;    { unavailable blocks at start.   usually 2 }
  1114.     DE_PREFAC           = 7;    { not used; must be 0 }
  1115.     DE_INTERLEAVE       = 8;    { usually 0 }
  1116.     DE_LOWCYL           = 9;    { starting cylinder. typically 0 }
  1117.     DE_UPPERCYL         = 10;   { max cylinder.  drive specific }
  1118.     DE_NUMBUFFERS       = 11;   { starting # of buffers.  typically 5 }
  1119.     DE_MEMBUFTYPE       = 12;   { type of mem to allocate for buffers. }
  1120.     DE_BUFMEMTYPE       = 12;   { same as above, better name
  1121.                                  * 1 is public, 3 is chip, 5 is fast }
  1122.     DE_MAXTRANSFER      = 13;   { Max number bytes to transfer at a time }
  1123.     DE_MASK             = 14;   { Address Mask to block out certain memory }
  1124.     DE_BOOTPRI          = 15;   { Boot priority for autoboot }
  1125.     DE_DOSTYPE          = 16;   { ASCII (HEX) string showing filesystem type;
  1126.                                  * 0X444F5300 is old filesystem,
  1127.                                  * 0X444F5301 is fast file system }
  1128.     DE_BAUD             = 17;   {     Baud rate for serial handler }
  1129.     DE_CONTROL          = 18;   {     Control Integer for handler/filesystem }
  1130.     DE_BOOTBLOCKS       = 19;   {     Number of blocks containing boot code }
  1131.  
  1132.  
  1133. { The file system startup message is linked into a device node's startup
  1134. ** field.  It contains a pointer to the above environment, plus the
  1135. ** information needed to do an exec OpenDevice().
  1136. }
  1137.  
  1138. Type
  1139.  
  1140.     pFileSysStartupMsg = ^tFileSysStartupMsg;
  1141.     tFileSysStartupMsg = record
  1142.         fssm_Unit       : ULONG;        { exec unit number for this device }
  1143.         fssm_Device     : BSTR;         { null terminated bstring to the device name }
  1144.         fssm_Environ    : BPTR;         { ptr to environment table (see above) }
  1145.         fssm_Flags      : ULONG;        { flags for OpenDevice() }
  1146.     end;
  1147.  
  1148.  
  1149. { The include file "libraries/dosextens.h" has a DeviceList structure.
  1150.  * The "device list" can have one of three different things linked onto
  1151.  * it.  Dosextens defines the structure for a volume.  DLT_DIRECTORY
  1152.  * is for an assigned directory.  The following structure is for
  1153.  * a dos "device" (DLT_DEVICE).
  1154. }
  1155.  
  1156.     pDeviceNode = ^tDeviceNode;
  1157.     tDeviceNode = record
  1158.         dn_Next         : BPTR;         { singly linked list }
  1159.         dn_Type         : ULONG;        { always 0 for dos "devices" }
  1160.         dn_Task         : pMsgPort;     { standard dos "task" field.  If this is
  1161.                                          * null when the node is accesses, a task
  1162.                                          * will be started up }
  1163.         dn_Lock         : BPTR;         { not used for devices -- leave null }
  1164.         dn_Handler      : BSTR;         { filename to loadseg (if seglist is null) }
  1165.         dn_StackSize    : ULONG;        { stacksize to use when starting task }
  1166.         dn_Priority     : Longint;      { task priority when starting task }
  1167.         dn_Startup      : BPTR;         { startup msg: FileSysStartupMsg for disks }
  1168.         dn_SegList      : BPTR;         { code to run to start new task (if necessary).
  1169.                                          * if null then dn_Handler will be loaded. }
  1170.         dn_GlobalVec    : BPTR; { BCPL global vector to use when starting
  1171.                                  * a task.  -1 means that dn_SegList is not
  1172.                                  * for a bcpl program, so the dos won't
  1173.                                  * try and construct one.  0 tell the
  1174.                                  * dos that you obey BCPL linkage rules,
  1175.                                  * and that it should construct a global
  1176.                                  * vector for you.
  1177.                                  }
  1178.         dn_Name         : BSTR;         { the node name, e.g. '\3','D','F','3' }
  1179.     end;
  1180.  
  1181. CONST
  1182. {     use of Class and code is discouraged for the time being - we might want to
  1183.    change things }
  1184. {     --- NotifyMessage Class ------------------------------------------------ }
  1185.      NOTIFY_CLASS  =  $40000000;
  1186.  
  1187. {     --- NotifyMessage Codes ------------------------------------------------ }
  1188.      NOTIFY_CODE   =  $1234;
  1189.  
  1190.  
  1191. {     Sent to the application if SEND_MESSAGE is specified.                    }
  1192.  
  1193. Type
  1194. {     Do not modify or reuse the notifyrequest while active.                   }
  1195. {     note: the first LONG of nr_Data has the length transfered                }
  1196.  
  1197.  
  1198.        pNotifyRequest = ^tNotifyRequest;
  1199.        tNotifyRequest = record
  1200.             nr_Name : pchar;
  1201.             nr_FullName : pchar;
  1202.             nr_UserData : ULONG;
  1203.             nr_Flags : ULONG;
  1204.             nr_stuff : record
  1205.                 case integer of
  1206.                    0 : ( nr_Msg : record
  1207.                         nr_Port : pMsgPort;
  1208.                      end );
  1209.                    1 : ( nr_Signal : record
  1210.                         nr_Task : pTask;
  1211.                         nr_SignalNum : BYTE;
  1212.                         nr_pad : array[0..2] of BYTE;
  1213.                      end );
  1214.                 end;
  1215.             nr_Reserved : array[0..3] of ULONG;
  1216.             nr_MsgCount : ULONG;
  1217.             nr_Handler : pMsgPort;
  1218.          end;
  1219.  
  1220.    pNotifyMessage = ^tNotifyMessage;
  1221.    tNotifyMessage = record
  1222.     nm_ExecMessage : tMessage;
  1223.     nm_Class       : ULONG;
  1224.     nm_Code        : Word;
  1225.     nm_NReq        : pNotifyRequest;     {     don't modify the request! }
  1226.     nm_DoNotTouch,                       {     like it says!  For use by handlers }
  1227.     nm_DoNotTouch2 : ULONG;            {     ditto }
  1228.    END;
  1229.  
  1230.  
  1231. CONST
  1232. {     --- NotifyRequest Flags ------------------------------------------------ }
  1233.      NRF_SEND_MESSAGE      =  1 ;
  1234.      NRF_SEND_SIGNAL       =  2 ;
  1235.      NRF_WAIT_REPLY        =  8 ;
  1236.      NRF_NOTIFY_INITIAL    =  16;
  1237.  
  1238. {     do NOT set or remove NRF_MAGIC!  Only for use by handlers! }
  1239.      NRF_MAGIC             = $80000000;
  1240.  
  1241. {     bit numbers }
  1242.      NRB_SEND_MESSAGE      =  0;
  1243.      NRB_SEND_SIGNAL       =  1;
  1244.      NRB_WAIT_REPLY        =  3;
  1245.      NRB_NOTIFY_INITIAL    =  4;
  1246.  
  1247.      NRB_MAGIC             =  31;
  1248.  
  1249. {     Flags reserved for private use by the handler: }
  1250.      NR_HANDLER_FLAGS      =  $ffff0000;
  1251.  
  1252. {   *********************************************************************
  1253.  *
  1254.  * The CSource data structure defines the input source for "ReadItem()"
  1255.  * as well as the ReadArgs call.  It is a publicly defined structure
  1256.  * which may be used by applications which use code that follows the
  1257.  * conventions defined for access.
  1258.  *
  1259.  * When passed to the dos.library functions, the value passed as
  1260.  * struct *CSource is defined as follows:
  1261.  *      if ( CSource == 0)      Use buffered IO "ReadChar()" as data source
  1262.  *      else                    Use CSource for input character stream
  1263.  *
  1264.  * The following two pseudo-code routines define how the CSource structure
  1265.  * is used:
  1266.  *
  1267.  * long CS_ReadChar( struct CSource *CSource )
  1268.  *
  1269.  *      if ( CSource == 0 )     return ReadChar();
  1270.  *      if ( CSource->CurChr >= CSource->Length )       return ENDSTREAMCHAR;
  1271.  *      return CSource->Buffer[ CSource->CurChr++ ];
  1272.  *
  1273.  *
  1274.  * BOOL CS_UnReadChar( struct CSource *CSource )
  1275.  *
  1276.  *      if ( CSource == 0 )     return UnReadChar();
  1277.  *      if ( CSource->CurChr <= 0 )     return FALSE;
  1278.  *      CSource->CurChr--;
  1279.  *      return TRUE;
  1280.  *
  1281.  *
  1282.  * To initialize a struct CSource, you set CSource->CS_Buffer to
  1283.  * a string which is used as the data source, and set CS_Length to
  1284.  * the number of characters in the string.  Normally CS_CurChr should
  1285.  * be initialized to ZERO, or left as it was from prior use as
  1286.  * a CSource.
  1287.  *
  1288.  *********************************************************************}
  1289.  
  1290. Type
  1291.        pCSource = ^tCSource;
  1292.        tCSource = record
  1293.         CS_Buffer  : STRPTR;
  1294.         CS_Length,
  1295.         CS_CurChr  : Longint;
  1296.        END;
  1297.  
  1298. {   *********************************************************************
  1299.  *
  1300.  * The RDArgs data structure is the input parameter passed to the DOS
  1301.  * ReadArgs() function call.
  1302.  *
  1303.  * The RDA_Source structure is a CSource as defined above;
  1304.  * if RDA_Source.CS_Buffer is non-null, RDA_Source is used as the input
  1305.  * character stream to parse, else the input comes from the buffered STDIN
  1306.  * calls ReadChar/UnReadChar.
  1307.  *
  1308.  * RDA_DAList is a private address which is used internally to track
  1309.  * allocations which are freed by FreeArgs().  This MUST be initialized
  1310.  * to NULL prior to the first call to ReadArgs().
  1311.  *
  1312.  * The RDA_Buffer and RDA_BufSiz fields allow the application to supply
  1313.  * a fixed-size buffer in which to store the parsed data.  This allows
  1314.  * the application to pre-allocate a buffer rather than requiring buffer
  1315.  * space to be allocated.  If either RDA_Buffer or RDA_BufSiz is NULL,
  1316.  * the application has not supplied a buffer.
  1317.  *
  1318.  * RDA_ExtHelp is a text string which will be displayed instead of the
  1319.  * template string, if the user is prompted for input.
  1320.  *
  1321.  * RDA_Flags bits control how ReadArgs() works.  The flag bits are
  1322.  * defined below.  Defaults are initialized to ZERO.
  1323.  *
  1324.  *********************************************************************}
  1325.  
  1326.        pRDArgs = ^tRDArgs;
  1327.        tRDArgs = record
  1328.         RDA_Source  : tCSource;     {    Select input source }
  1329.         RDA_DAList  : Longint;      {    PRIVATE. }
  1330.         RDA_Buffer  : STRPTR;       {    Optional string parsing space. }
  1331.         RDA_BufSiz  : Longint;      {    Size of RDA_Buffer (0..n) }
  1332.         RDA_ExtHelp : STRPTR;       {    Optional extended help }
  1333.         RDA_Flags   : Longint;      {    Flags for any required control }
  1334.        END;
  1335.  
  1336. CONST
  1337.        RDAB_STDIN     = 0;       {    Use "STDIN" rather than "COMMAND LINE" }
  1338.        RDAF_STDIN     = 1;
  1339.        RDAB_NOALLOC   = 1;       {    If set, do not allocate extra string space.}
  1340.        RDAF_NOALLOC   = 2;
  1341.        RDAB_NOPROMPT  = 2;       {    Disable reprompting for string input. }
  1342.        RDAF_NOPROMPT  = 4;
  1343.  
  1344. {   *********************************************************************
  1345.  * Maximum number of template keywords which can be in a template passed
  1346.  * to ReadArgs(). IMPLEMENTOR NOTE - must be a multiple of 4.
  1347.  *********************************************************************}
  1348.        MAX_TEMPLATE_ITEMS     = 100;
  1349.  
  1350. {   *********************************************************************
  1351.  * Maximum number of MULTIARG items returned by ReadArgs(), before
  1352.  * an ERROR_LINE_TOO_LONG.  These two limitations are due to stack
  1353.  * usage.  Applications should allow "a lot" of stack to use ReadArgs().
  1354.  *********************************************************************}
  1355.        MAX_MULTIARGS          = 128;
  1356.  
  1357. CONST
  1358. {     Modes for LockRecord/LockRecords() }
  1359.        REC_EXCLUSIVE          = 0;
  1360.        REC_EXCLUSIVE_IMMED    = 1;
  1361.        REC_SHARED             = 2;
  1362.        REC_SHARED_IMMED       = 3;
  1363.  
  1364. {     struct to be passed to LockRecords()/UnLockRecords() }
  1365.  
  1366. Type
  1367.        pRecordLock = ^tRecordLock;
  1368.        tRecordLock = record
  1369.         rec_FH    : BPTR;         {     filehandle }
  1370.         rec_Offset,               {     offset in file }
  1371.         rec_Length,               {     length of file to be locked }
  1372.         rec_Mode  : ULONG;        {     Type of lock }
  1373.        END;
  1374.  
  1375.  
  1376. {      the structure in the pr_LocalVars list }
  1377. {      Do NOT allocate yourself, use SetVar()!!! This structure may grow in }
  1378. {      future releases!  The list should be left in alphabetical order, and }
  1379. {      may have multiple entries with the same name but different types.    }
  1380. Type
  1381.        pLocalVar = ^tLocalVar;
  1382.        tLocalVar = record
  1383.         lv_Node  : tNode;
  1384.         lv_Flags : Word;
  1385.         lv_Value : STRPTR;
  1386.         lv_Len   : ULONG;
  1387.        END;
  1388.  
  1389. {
  1390.  * The lv_Flags bits are available to the application.  The unused
  1391.  * lv_Node.ln_Pri bits are reserved for system use.
  1392.  }
  1393.  
  1394. CONST
  1395. {      bit definitions for lv_Node.ln_Type: }
  1396.        LV_VAR               =   0;       {      an variable }
  1397.        LV_ALIAS             =   1;       {      an alias }
  1398. {      to be or'ed into type: }
  1399.        LVB_IGNORE           =   7;       {      ignore this entry on GetVar, etc }
  1400.        LVF_IGNORE           =   $80;
  1401.  
  1402. {      definitions of flags passed to GetVar()/SetVar()/DeleteVar() }
  1403. {      bit defs to be OR'ed with the type: }
  1404. {      item will be treated as a single line of text unless BINARY_VAR is used }
  1405.        GVB_GLOBAL_ONLY       =  8   ;
  1406.        GVF_GLOBAL_ONLY       =  $100;
  1407.        GVB_LOCAL_ONLY        =  9   ;
  1408.        GVF_LOCAL_ONLY        =  $200;
  1409.        GVB_BINARY_VAR        =  10  ;            {      treat variable as binary }
  1410.        GVF_BINARY_VAR        =  $400;
  1411.        GVB_DONT_NULL_TERM    =  11;            { only with GVF_BINARY_VAR }
  1412.        GVF_DONT_NULL_TERM    =  $800;
  1413.  
  1414. { this is only supported in >= V39 dos.  V37 dos ignores this. }
  1415. { this causes SetVar to affect ENVARC: as well as ENV:.        }
  1416.       GVB_SAVE_VAR           = 12 ;     { only with GVF_GLOBAL_VAR }
  1417.       GVF_SAVE_VAR           = $1000 ;
  1418.  
  1419.  
  1420. CONST
  1421. {   ***************************************************************************}
  1422. {    definitions for the System() call }
  1423.  
  1424.     SYS_Dummy      = (TAG_USER + 32);
  1425.     SYS_Input      = (SYS_Dummy + 1);
  1426.                                 {    specifies the input filehandle  }
  1427.     SYS_Output     = (SYS_Dummy + 2);
  1428.                                 {    specifies the output filehandle }
  1429.     SYS_Asynch     = (SYS_Dummy + 3);
  1430.                                 {    run asynch, close input/output on exit(!) }
  1431.     SYS_UserShell  = (SYS_Dummy + 4);
  1432.                                 {    send to user shell instead of boot shell }
  1433.     SYS_CustomShell= (SYS_Dummy + 5);
  1434.                                 {    send to a specific shell (data is name) }
  1435. {         SYS_Error, }
  1436.  
  1437.  
  1438. {   ***************************************************************************}
  1439. {    definitions for the CreateNewProc() call }
  1440. {    you MUST specify one of NP_Seglist or NP_Entry.  All else is optional. }
  1441.  
  1442.     NP_Dummy       = (TAG_USER + 1000);
  1443.     NP_Seglist     = (NP_Dummy + 1);
  1444.                                 {    seglist of code to run for the process  }
  1445.     NP_FreeSeglist = (NP_Dummy + 2);
  1446.                                 {    free seglist on exit - only valid for   }
  1447.                                 {    for NP_Seglist.  Default is TRUE.       }
  1448.     NP_Entry       = (NP_Dummy + 3);
  1449.                                 {    entry point to run - mutually exclusive }
  1450.                                 {    with NP_Seglist! }
  1451.     NP_Input       = (NP_Dummy + 4);
  1452.                                 {    filehandle - default is Open("NIL:"...) }
  1453.     NP_Output      = (NP_Dummy + 5);
  1454.                                 {    filehandle - default is Open("NIL:"...) }
  1455.     NP_CloseInput  = (NP_Dummy + 6);
  1456.                                 {    close input filehandle on exit          }
  1457.                                 {    default TRUE                            }
  1458.     NP_CloseOutput = (NP_Dummy + 7);
  1459.                                 {    close output filehandle on exit         }
  1460.                                 {    default TRUE                            }
  1461.     NP_Error       = (NP_Dummy + 8);
  1462.                                 {    filehandle - default is Open("NIL:"...) }
  1463.     NP_CloseError  = (NP_Dummy + 9);
  1464.                                 {    close error filehandle on exit          }
  1465.                                 {    default TRUE                            }
  1466.     NP_CurrentDir  = (NP_Dummy + 10);
  1467.                                 {    lock - default is parent's current dir  }
  1468.     NP_StackSize   = (NP_Dummy + 11);
  1469.                                 {    stacksize for process - default 4000    }
  1470.     NP_Name        = (NP_Dummy + 12);
  1471.                                 {    name for process - default "New Process"}
  1472.     NP_Priority    = (NP_Dummy + 13);
  1473.                                 {    priority - default same as parent       }
  1474.     NP_ConsoleTask = (NP_Dummy + 14);
  1475.                                 {    consoletask - default same as parent    }
  1476.     NP_WindowPtr   = (NP_Dummy + 15);
  1477.                                 {    window ptr - default is same as parent  }
  1478.     NP_HomeDir     = (NP_Dummy + 16);
  1479.                                 {    home directory - default curr home dir  }
  1480.     NP_CopyVars    = (NP_Dummy + 17);
  1481.                                 {    boolean to copy local vars-default TRUE }
  1482.     NP_Cli         = (NP_Dummy + 18);
  1483.                                 {    create cli structure - default FALSE    }
  1484.     NP_Path        = (NP_Dummy + 19);
  1485.                                 {    path - default is copy of parents path  }
  1486.                                 {    only valid if a cli process!    }
  1487.     NP_CommandName = (NP_Dummy + 20);
  1488.                                 {    commandname - valid only for CLI        }
  1489.     NP_Arguments   = (NP_Dummy + 21);
  1490.                                 {    cstring of arguments - passed with str  }
  1491.                                 {    in a0, length in d0.  (copied and freed }
  1492.                                 {    on exit.  Default is empty string.      }
  1493.                                 {    NOTE: not operational until 2.04 - see  }
  1494.                                 {    BIX/TechNotes for more info/workarounds }
  1495.                                 {    NOTE: in 2.0, it DIDN'T pass "" - the   }
  1496.                                 {    registers were random.                  }
  1497. {    FIX! should this be only for cli's? }
  1498.     NP_NotifyOnDeath = (NP_Dummy + 22);
  1499.                                 {    notify parent on death - default FALSE  }
  1500.                                 {    Not functional yet. }
  1501.     NP_Synchronous   = (NP_Dummy + 23);
  1502.                                 {    don't return until process finishes -   }
  1503.                                 {    default FALSE.                          }
  1504.                                 {    Not functional yet. }
  1505.     NP_ExitCode      = (NP_Dummy + 24);
  1506.                                 {    code to be called on process exit       }
  1507.     NP_ExitData      = (NP_Dummy + 25);
  1508.                                 {    optional argument for NP_EndCode rtn -  }
  1509.                                 {    default NULL                            }
  1510.  
  1511.  
  1512. {   ***************************************************************************}
  1513. {    tags for AllocDosObject }
  1514.  
  1515.     ADO_Dummy        = (TAG_USER + 2000);
  1516.     ADO_FH_Mode      = (ADO_Dummy + 1);
  1517.                                 {    for type DOS_FILEHANDLE only            }
  1518.                                 {    sets up FH for mode specified.
  1519.                                    This can make a big difference for buffered
  1520.                                    files.                                  }
  1521.         {    The following are for DOS_CLI }
  1522.         {    If you do not specify these, dos will use it's preferred values }
  1523.         {    which may change from release to release.  The BPTRs to these   }
  1524.         {    will be set up correctly for you.  Everything will be zero,     }
  1525.         {    except cli_FailLevel (10) and cli_Background (DOSTRUE).         }
  1526.         {    NOTE: you may also use these 4 tags with CreateNewProc.         }
  1527.  
  1528.     ADO_DirLen     = (ADO_Dummy + 2);
  1529.                                 {    size in bytes for current dir buffer    }
  1530.     ADO_CommNameLen= (ADO_Dummy + 3);
  1531.                                 {    size in bytes for command name buffer   }
  1532.     ADO_CommFileLen= (ADO_Dummy + 4);
  1533.                                 {    size in bytes for command file buffer   }
  1534.     ADO_PromptLen  = (ADO_Dummy + 5);
  1535.                                 {    size in bytes for the prompt buffer     }
  1536.  
  1537. {   ***************************************************************************}
  1538. {    tags for NewLoadSeg }
  1539. {    no tags are defined yet for NewLoadSeg }
  1540.  
  1541.  
  1542. PROCEDURE AbortPkt(port : pMsgPort; pkt : pDosPacket);
  1543. FUNCTION AddBuffers(name : pCHAR; number : LONGINT) : BOOLEAN;
  1544. FUNCTION AddDosEntry(dlist : pDosList) : BOOLEAN;
  1545. FUNCTION AddPart(dirname : pCHAR; filename : pCHAR; size : ULONG) : BOOLEAN;
  1546. FUNCTION AddSegment(name : pCHAR; seg : LONGINT; system : LONGINT) : BOOLEAN;
  1547. FUNCTION AllocDosObject(type_ : ULONG; tags : pTagItem) : POINTER;
  1548. FUNCTION AllocDosObjectTagList(type_ : ULONG; tags : pTagItem) : POINTER;
  1549. FUNCTION AssignAdd(name : pCHAR; lock : LONGINT) : BOOLEAN;
  1550. FUNCTION AssignLate(name : pCHAR; path : pCHAR) : BOOLEAN;
  1551. FUNCTION AssignLock(name : pCHAR; lock : LONGINT) : BOOLEAN;
  1552. FUNCTION AssignPath(name : pCHAR; path : pCHAR) : BOOLEAN;
  1553. FUNCTION AttemptLockDosList(flags : ULONG) : pDosList;
  1554. FUNCTION ChangeMode(type_ : LONGINT; fh : LONGINT; newmode : LONGINT) : BOOLEAN;
  1555. FUNCTION CheckSignal(mask : LONGINT) : LONGINT;
  1556. FUNCTION Cli : pCommandLineInterface;
  1557. FUNCTION CliInitNewcli(dp : pDosPacket) : LONGINT;
  1558. FUNCTION CliInitRun(dp : pDosPacket) : LONGINT;
  1559. FUNCTION CompareDates(date1 : pDateStamp; date2 : pDateStamp) : LONGINT;
  1560. FUNCTION CreateDir(name : pCHAR) : LONGINT;
  1561. FUNCTION CreateNewProc(tags : pTagItem) : pProcess;
  1562. FUNCTION CreateNewProcTagList(tags : pTagItem) : pProcess;
  1563. FUNCTION CreateProc(name : pCHAR; pri : LONGINT; segList : LONGINT; stackSize : LONGINT) : pMsgPort;
  1564. FUNCTION CurrentDir(lock : LONGINT) : LONGINT;
  1565. PROCEDURE DateStamp(VAR date : pDateStamp);
  1566. FUNCTION DateToStr(datetime : pDateTime) : BOOLEAN;
  1567. FUNCTION DeleteFile(name : pCHAR) : BOOLEAN;
  1568. FUNCTION DeleteVar(name : pCHAR; flags : ULONG) : BOOLEAN;
  1569. FUNCTION DeviceProc(name : pCHAR) : pMsgPort;
  1570. FUNCTION DoPkt(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT; arg3 : LONGINT; arg4 : LONGINT; arg5 : LONGINT) : LONGINT;
  1571. FUNCTION DoPkt0(port : pMsgPort; action : LONGINT) : LONGINT;
  1572. FUNCTION DoPkt1(port : pMsgPort; action : LONGINT; arg1 : LONGINT) : LONGINT;
  1573. FUNCTION DoPkt2(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT) : LONGINT;
  1574. FUNCTION DoPkt3(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT; arg3 : LONGINT) : LONGINT;
  1575. FUNCTION DoPkt4(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT; arg3 : LONGINT; arg4 : LONGINT) : LONGINT;
  1576. PROCEDURE DOSClose(file_ : LONGINT);
  1577. PROCEDURE DOSDelay(timeout : LONGINT);
  1578. PROCEDURE DOSExit(returnCode : LONGINT);
  1579. FUNCTION DOSFlush(fh : LONGINT) : BOOLEAN;
  1580. FUNCTION DOSInput : LONGINT;
  1581. FUNCTION DOSOpen(name : pCHAR; accessMode : LONGINT) : LONGINT;
  1582. FUNCTION DOSOutput : LONGINT;
  1583. FUNCTION DOSRead(file_ : LONGINT; buffer : POINTER; length : LONGINT) : LONGINT;
  1584. FUNCTION DOSRename(oldName : pCHAR; newName : pCHAR) : LONGINT;
  1585. FUNCTION DOSSeek(file_ : LONGINT; position : LONGINT; offset : LONGINT) : LONGINT;
  1586. FUNCTION DOSWrite(file_ : LONGINT; buffer : POINTER; length : LONGINT) : LONGINT;
  1587. FUNCTION DupLock(lock : LONGINT) : LONGINT;
  1588. FUNCTION DupLockFromFH(fh : LONGINT) : LONGINT;
  1589. PROCEDURE EndNotify(notify : pNotifyRequest);
  1590. FUNCTION ErrorReport(code : LONGINT; type_ : LONGINT; arg1 : ULONG; device : pMsgPort) : BOOLEAN;
  1591. FUNCTION ExAll(lock : LONGINT; buffer : pExAllData; size : LONGINT; data : LONGINT; control : pExAllControl) : BOOLEAN;
  1592. PROCEDURE ExAllEnd(lock : LONGINT; buffer : pExAllData; size : LONGINT; data : LONGINT; control : pExAllControl);
  1593. FUNCTION Examine(lock : LONGINT; fileInfoBlock : pFileInfoBlock) : BOOLEAN;
  1594. FUNCTION ExamineFH(fh : LONGINT; fib : pFileInfoBlock) : BOOLEAN;
  1595. FUNCTION Execute(string_ : pCHAR; file_ : LONGINT; file2 : LONGINT) : BOOLEAN;
  1596. FUNCTION ExNext(lock : LONGINT; fileInfoBlock : pFileInfoBlock) : BOOLEAN;
  1597. FUNCTION Fault(code : LONGINT; header : pCHAR; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  1598. FUNCTION FGetC(fh : LONGINT) : LONGINT;
  1599. FUNCTION FGets(fh : LONGINT; buf : pCHAR; buflen : ULONG) : pCHAR;
  1600. FUNCTION FilePart(path : pCHAR) : pCHAR;
  1601. FUNCTION FindArg(keyword : pCHAR; arg_template : pCHAR) : LONGINT;
  1602. FUNCTION FindCliProc(num : ULONG) : pProcess;
  1603. FUNCTION FindDosEntry(dlist : pDosList; name : pCHAR; flags : ULONG) : pDosList;
  1604. FUNCTION FindSegment(name : pCHAR; seg : pSegment; system : LONGINT) : pSegment;
  1605. FUNCTION FindVar(name : pCHAR; type_ : ULONG) : pLocalVar;
  1606. FUNCTION Format(filesystem : pCHAR; volumename : pCHAR; dostype : ULONG) : BOOLEAN;
  1607. FUNCTION FPutC(fh : LONGINT; ch : LONGINT) : LONGINT;
  1608. FUNCTION FPuts(fh : LONGINT; str : pCHAR) : BOOLEAN;
  1609. FUNCTION FRead(fh : LONGINT; block : POINTER; blocklen : ULONG; number : ULONG) : LONGINT;
  1610. PROCEDURE FreeArgs(args : pRDArgs);
  1611. PROCEDURE FreeDeviceProc(dp : pDevProc);
  1612. PROCEDURE FreeDosEntry(dlist : pDosList);
  1613. PROCEDURE FreeDosObject(type_ : ULONG; ptr : POINTER);
  1614. FUNCTION FWrite(fh : LONGINT; block : POINTER; blocklen : ULONG; number : ULONG) : LONGINT;
  1615. FUNCTION GetArgStr : pCHAR;
  1616. FUNCTION GetConsoleTask : pMsgPort;
  1617. FUNCTION GetCurrentDirName(buf : pCHAR; len : LONGINT) : BOOLEAN;
  1618. FUNCTION GetDeviceProc(name : pCHAR; dp : pDevProc) : pDevProc;
  1619. FUNCTION GetFileSysTask : pMsgPort;
  1620. FUNCTION GetProgramDir : LONGINT;
  1621. FUNCTION GetProgramName(buf : pCHAR; len : LONGINT) : BOOLEAN;
  1622. FUNCTION GetPrompt(buf : pCHAR; len : LONGINT) : BOOLEAN;
  1623. FUNCTION GetVar(name : pCHAR; buffer : pCHAR; size : LONGINT; flags : LONGINT) : LONGINT;
  1624. FUNCTION Info(lock : LONGINT; parameterBlock : pInfoData) : BOOLEAN;
  1625. FUNCTION Inhibit(name : pCHAR; onoff : LONGINT) : BOOLEAN;
  1626. FUNCTION InternalLoadSeg(fh : LONGINT; table : LONGINT; VAR funcarray : LONGINT; VAR stack : LONGINT) : LONGINT;
  1627. FUNCTION InternalUnLoadSeg(seglist : LONGINT; freefunc : tPROCEDURE) : BOOLEAN;
  1628. FUNCTION IoErr : LONGINT;
  1629. FUNCTION IsFileSystem(name : pCHAR) : BOOLEAN;
  1630. FUNCTION IsInteractive(file_ : LONGINT) : BOOLEAN;
  1631. FUNCTION LoadSeg(name : pCHAR) : LONGINT;
  1632. FUNCTION Lock(name : pCHAR; type_ : LONGINT) : LONGINT;
  1633. FUNCTION LockDosList(flags : ULONG) : pDosList;
  1634. FUNCTION LockRecord(fh : LONGINT; offset : ULONG; length : ULONG; mode : ULONG; timeout : ULONG) : BOOLEAN;
  1635. FUNCTION LockRecords(recArray : pRecordLock; timeout : ULONG) : BOOLEAN;
  1636. FUNCTION MakeDosEntry(name : pCHAR; type_ : LONGINT) : pDosList;
  1637. FUNCTION MakeLink(name : pCHAR; dest : LONGINT; soft : LONGINT) : BOOLEAN;
  1638. PROCEDURE MatchEnd(anchor : pAnchorPath);
  1639. FUNCTION MatchFirst(pat : pCHAR; anchor : pAnchorPath) : LONGINT;
  1640. FUNCTION MatchNext(anchor : pAnchorPath) : LONGINT;
  1641. FUNCTION MatchPattern(pat : pCHAR; str : pCHAR) : BOOLEAN;
  1642. FUNCTION MatchPatternNoCase(pat : pCHAR; str : pCHAR) : BOOLEAN;
  1643. FUNCTION MaxCli : ULONG;
  1644. FUNCTION NameFromFH(fh : LONGINT; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  1645. FUNCTION NameFromLock(lock : LONGINT; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  1646. FUNCTION NewLoadSeg(file_ : pCHAR; tags : pTagItem) : LONGINT;
  1647. FUNCTION NewLoadSegTagList(file_ : pCHAR; tags : pTagItem) : LONGINT;
  1648. FUNCTION NextDosEntry(dlist : pDosList; flags : ULONG) : pDosList;
  1649. FUNCTION OpenFromLock(lock : LONGINT) : LONGINT;
  1650. FUNCTION ParentDir(lock : LONGINT) : LONGINT;
  1651. FUNCTION ParentOfFH(fh : LONGINT) : LONGINT;
  1652. FUNCTION ParsePattern(pat : pCHAR; buf : pCHAR; buflen : LONGINT) : LONGINT;
  1653. FUNCTION ParsePatternNoCase(pat : pCHAR; buf : pCHAR; buflen : LONGINT) : LONGINT;
  1654. FUNCTION PathPart(path : pCHAR) : pCHAR;
  1655. FUNCTION PrintFault(code : LONGINT; header : pCHAR) : BOOLEAN;
  1656. FUNCTION PutStr(str : pCHAR) : BOOLEAN;
  1657. FUNCTION ReadArgs(arg_template : pCHAR; VAR arra : LONGINT; args : pRDArgs) : pRDArgs;
  1658. FUNCTION ReadItem(name : pCHAR; maxchars : LONGINT; cSource : pCSource) : LONGINT;
  1659. FUNCTION ReadLink(port : pMsgPort; lock : LONGINT; path : pCHAR; buffer : pCHAR; size : ULONG) : BOOLEAN;
  1660. FUNCTION Relabel(drive : pCHAR; newname : pCHAR) : BOOLEAN;
  1661. FUNCTION RemAssignList(name : pCHAR; lock : LONGINT) : BOOLEAN;
  1662. FUNCTION RemDosEntry(dlist : pDosList) : BOOLEAN;
  1663. FUNCTION RemSegment(seg : pSegment) : BOOLEAN;
  1664. PROCEDURE ReplyPkt(dp : pDosPacket; res1 : LONGINT; res2 : LONGINT);
  1665. FUNCTION RunCommand(seg : LONGINT; stack : LONGINT; paramptr : pCHAR; paramlen : LONGINT) : LONGINT;
  1666. FUNCTION SameDevice(lock1 : LONGINT; lock2 : LONGINT) : BOOLEAN;
  1667. FUNCTION SameLock(lock1 : LONGINT; lock2 : LONGINT) : LONGINT;
  1668. FUNCTION SelectInput(fh : LONGINT) : LONGINT;
  1669. FUNCTION SelectOutput(fh : LONGINT) : LONGINT;
  1670. PROCEDURE SendPkt(dp : pDosPacket; port : pMsgPort; replyport : pMsgPort);
  1671. FUNCTION SetArgStr(string_ : pCHAR) : BOOLEAN;
  1672. FUNCTION SetComment(name : pCHAR; comment : pCHAR) : BOOLEAN;
  1673. FUNCTION SetConsoleTask(task : pMsgPort) : pMsgPort;
  1674. FUNCTION SetCurrentDirName(name : pCHAR) : BOOLEAN;
  1675. FUNCTION SetFileDate(name : pCHAR; date : pDateStamp) : BOOLEAN;
  1676. FUNCTION SetFileSize(fh : LONGINT; pos : LONGINT; mode : LONGINT) : BOOLEAN;
  1677. FUNCTION SetFileSysTask(task : pMsgPort) : pMsgPort;
  1678. FUNCTION SetIoErr(result : LONGINT) : LONGINT;
  1679. FUNCTION SetMode(fh : LONGINT; mode : LONGINT) : BOOLEAN;
  1680. FUNCTION SetOwner(name : pCHAR; owner_info : LONGINT) : BOOLEAN;
  1681. FUNCTION SetProgramDir(lock : LONGINT) : LONGINT;
  1682. FUNCTION SetProgramName(name : pCHAR) : BOOLEAN;
  1683. FUNCTION SetPrompt(name : pCHAR) : BOOLEAN;
  1684. FUNCTION SetProtection(name : pCHAR; protect : LONGINT) : BOOLEAN;
  1685. FUNCTION SetVar(name : pCHAR; buffer : pCHAR; size : LONGINT; flags : LONGINT) : BOOLEAN;
  1686. FUNCTION SetVBuf(fh : LONGINT; buff : pCHAR; type_ : LONGINT; size : LONGINT) : BOOLEAN;
  1687. FUNCTION SplitName(name : pCHAR; seperator : ULONG; buf : pCHAR; oldpos : LONGINT; size : LONGINT) : INTEGER;
  1688. FUNCTION StartNotify(notify : pNotifyRequest) : BOOLEAN;
  1689. FUNCTION StrToDate(datetime : pDateTime) : BOOLEAN;
  1690. FUNCTION StrToLong(string_ : pCHAR; VAR value : LONGINT) : LONGINT;
  1691. FUNCTION SystemTagList(command : pCHAR; tags : pTagItem) : LONGINT;
  1692. FUNCTION DOSSystem(command : pCHAR; tags : pTagItem) : LONGINT;
  1693. FUNCTION UnGetC(fh : LONGINT; character : LONGINT) : LONGINT;
  1694. PROCEDURE UnLoadSeg(seglist : LONGINT);
  1695. PROCEDURE UnLock(lock : LONGINT);
  1696. PROCEDURE UnLockDosList(flags : ULONG);
  1697. FUNCTION UnLockRecord(fh : LONGINT; offset : ULONG; length : ULONG) : BOOLEAN;
  1698. FUNCTION UnLockRecords(recArray : pRecordLock) : BOOLEAN;
  1699. FUNCTION VFPrintf(fh : LONGINT; format : pCHAR; argarray : POINTER) : LONGINT;
  1700. PROCEDURE VFWritef(fh : LONGINT; format : pCHAR; VAR argarray : LONGINT);
  1701. FUNCTION VPrintf(format : pCHAR; argarray : POINTER) : LONGINT;
  1702. FUNCTION WaitForChar(file_ : LONGINT; timeout : LONGINT) : BOOLEAN;
  1703. FUNCTION WaitPkt : pDosPacket;
  1704. FUNCTION WriteChars(buf : pCHAR; buflen : ULONG) : LONGINT;
  1705.  
  1706. FUNCTION BADDR(bval :BPTR): POINTER;
  1707. FUNCTION MKBADDR(adr: Pointer): BPTR;
  1708.  
  1709. IMPLEMENTATION
  1710.  
  1711. FUNCTION BADDR(bval : BPTR): POINTER;
  1712. BEGIN
  1713.     BADDR := POINTER( bval shl 2);
  1714. END;
  1715.  
  1716. FUNCTION MKBADDR(adr : POINTER): BPTR;
  1717. BEGIN
  1718.     MKBADDR := BPTR( LONGINT(adr) shr 2);
  1719. END;
  1720.  
  1721. PROCEDURE AbortPkt(port : pMsgPort; pkt : pDosPacket);
  1722. BEGIN
  1723.   ASM
  1724.     MOVE.L  A6,-(A7)
  1725.     MOVE.L  port,D1
  1726.     MOVE.L  pkt,D2
  1727.     MOVEA.L _DOSBase,A6
  1728.     JSR -264(A6)
  1729.     MOVEA.L (A7)+,A6
  1730.   END;
  1731. END;
  1732.  
  1733. FUNCTION AddBuffers(name : pCHAR; number : LONGINT) : BOOLEAN;
  1734. BEGIN
  1735.   ASM
  1736.     MOVE.L  A6,-(A7)
  1737.     MOVE.L  name,D1
  1738.     MOVE.L  number,D2
  1739.     MOVEA.L _DOSBase,A6
  1740.     JSR -732(A6)
  1741.     MOVEA.L (A7)+,A6
  1742.     TST.L   D0
  1743.     BEQ.B   @end
  1744.     MOVEQ   #1,D0
  1745.     @end: MOVE.B  D0,@RESULT
  1746.   END;
  1747. END;
  1748.  
  1749. FUNCTION AddDosEntry(dlist : pDosList) : BOOLEAN;
  1750. BEGIN
  1751.   ASM
  1752.     MOVE.L  A6,-(A7)
  1753.     MOVE.L  dlist,D1
  1754.     MOVEA.L _DOSBase,A6
  1755.     JSR -678(A6)
  1756.     MOVEA.L (A7)+,A6
  1757.     TST.L   D0
  1758.     BEQ.B   @end
  1759.     MOVEQ   #1,D0
  1760.     @end: MOVE.B  D0,@RESULT
  1761.   END;
  1762. END;
  1763.  
  1764. FUNCTION AddPart(dirname : pCHAR; filename : pCHAR; size : ULONG) : BOOLEAN;
  1765. BEGIN
  1766.   ASM
  1767.     MOVE.L  A6,-(A7)
  1768.     MOVE.L  dirname,D1
  1769.     MOVE.L  filename,D2
  1770.     MOVE.L  size,D3
  1771.     MOVEA.L _DOSBase,A6
  1772.     JSR -882(A6)
  1773.     MOVEA.L (A7)+,A6
  1774.     TST.W   D0
  1775.     BEQ.B   @end
  1776.     MOVEQ   #1,D0
  1777.   @end: MOVE.B  D0,@RESULT
  1778.   END;
  1779. END;
  1780.  
  1781. FUNCTION AddSegment(name : pCHAR; seg : LONGINT; system : LONGINT) : BOOLEAN;
  1782. BEGIN
  1783.   ASM
  1784.     MOVE.L  A6,-(A7)
  1785.     MOVE.L  name,D1
  1786.     MOVE.L  seg,D2
  1787.     MOVE.L  system,D3
  1788.     MOVEA.L _DOSBase,A6
  1789.     JSR -774(A6)
  1790.     MOVEA.L (A7)+,A6
  1791.     TST.L   D0
  1792.     BEQ.B   @end
  1793.     MOVEQ   #1,D0
  1794.     @end: MOVE.B  D0,@RESULT
  1795.   END;
  1796. END;
  1797.  
  1798. FUNCTION AllocDosObject(type_ : ULONG; tags : pTagItem) : POINTER;
  1799. BEGIN
  1800.   ASM
  1801.     MOVE.L  A6,-(A7)
  1802.     MOVE.L  type_,D1
  1803.     MOVE.L  tags,D2
  1804.     MOVEA.L _DOSBase,A6
  1805.     JSR -228(A6)
  1806.     MOVEA.L (A7)+,A6
  1807.     MOVE.L  D0,@RESULT
  1808.   END;
  1809. END;
  1810.  
  1811. FUNCTION AllocDosObjectTagList(type_ : ULONG; tags : pTagItem) : POINTER;
  1812. BEGIN
  1813.   ASM
  1814.     MOVE.L  A6,-(A7)
  1815.     MOVE.L  type_,D1
  1816.     MOVE.L  tags,D2
  1817.     MOVEA.L _DOSBase,A6
  1818.     JSR -228(A6)
  1819.     MOVEA.L (A7)+,A6
  1820.     MOVE.L  D0,@RESULT
  1821.   END;
  1822. END;
  1823.  
  1824. FUNCTION AssignAdd(name : pCHAR; lock : LONGINT) : BOOLEAN;
  1825. BEGIN
  1826.   ASM
  1827.     MOVE.L  A6,-(A7)
  1828.     MOVE.L  name,D1
  1829.     MOVE.L  lock,D2
  1830.     MOVEA.L _DOSBase,A6
  1831.     JSR -630(A6)
  1832.     MOVEA.L (A7)+,A6
  1833.     TST.W   D0
  1834.     BEQ.B   @end
  1835.     MOVEQ   #1,D0
  1836.   @end: MOVE.B  D0,@RESULT
  1837.   END;
  1838. END;
  1839.  
  1840. FUNCTION AssignLate(name : pCHAR; path : pCHAR) : BOOLEAN;
  1841. BEGIN
  1842.   ASM
  1843.     MOVE.L  A6,-(A7)
  1844.     MOVE.L  name,D1
  1845.     MOVE.L  path,D2
  1846.     MOVEA.L _DOSBase,A6
  1847.     JSR -618(A6)
  1848.     MOVEA.L (A7)+,A6
  1849.     TST.W   D0
  1850.     BEQ.B   @end
  1851.     MOVEQ   #1,D0
  1852.   @end: MOVE.B  D0,@RESULT
  1853.   END;
  1854. END;
  1855.  
  1856. FUNCTION AssignLock(name : pCHAR; lock : LONGINT) : BOOLEAN;
  1857. BEGIN
  1858.   ASM
  1859.     MOVE.L  A6,-(A7)
  1860.     MOVE.L  name,D1
  1861.     MOVE.L  lock,D2
  1862.     MOVEA.L _DOSBase,A6
  1863.     JSR -612(A6)
  1864.     MOVEA.L (A7)+,A6
  1865.     TST.L   D0
  1866.     BEQ.B   @end
  1867.     MOVEQ   #1,D0
  1868.     @end: MOVE.B  D0,@RESULT
  1869.   END;
  1870. END;
  1871.  
  1872. FUNCTION AssignPath(name : pCHAR; path : pCHAR) : BOOLEAN;
  1873. BEGIN
  1874.   ASM
  1875.     MOVE.L  A6,-(A7)
  1876.     MOVE.L  name,D1
  1877.     MOVE.L  path,D2
  1878.     MOVEA.L _DOSBase,A6
  1879.     JSR -624(A6)
  1880.     MOVEA.L (A7)+,A6
  1881.     TST.W   D0
  1882.     BEQ.B   @end
  1883.     MOVEQ   #1,D0
  1884.   @end: MOVE.B  D0,@RESULT
  1885.   END;
  1886. END;
  1887.  
  1888. FUNCTION AttemptLockDosList(flags : ULONG) : pDosList;
  1889. BEGIN
  1890.   ASM
  1891.     MOVE.L  A6,-(A7)
  1892.     MOVE.L  flags,D1
  1893.     MOVEA.L _DOSBase,A6
  1894.     JSR -666(A6)
  1895.     MOVEA.L (A7)+,A6
  1896.     MOVE.L  D0,@RESULT
  1897.   END;
  1898. END;
  1899.  
  1900. FUNCTION ChangeMode(type_ : LONGINT; fh : LONGINT; newmode : LONGINT) : BOOLEAN;
  1901. BEGIN
  1902.   ASM
  1903.     MOVE.L  A6,-(A7)
  1904.     MOVE.L  type_,D1
  1905.     MOVE.L  fh,D2
  1906.     MOVE.L  newmode,D3
  1907.     MOVEA.L _DOSBase,A6
  1908.     JSR -450(A6)
  1909.     MOVEA.L (A7)+,A6
  1910.     TST.L   D0
  1911.     BEQ.B   @end
  1912.     MOVEQ   #1,D0
  1913.     @end: MOVE.B  D0,@RESULT
  1914.   END;
  1915. END;
  1916.  
  1917. FUNCTION CheckSignal(mask : LONGINT) : LONGINT;
  1918. BEGIN
  1919.   ASM
  1920.     MOVE.L  A6,-(A7)
  1921.     MOVE.L  mask,D1
  1922.     MOVEA.L _DOSBase,A6
  1923.     JSR -792(A6)
  1924.     MOVEA.L (A7)+,A6
  1925.     MOVE.L  D0,@RESULT
  1926.   END;
  1927. END;
  1928.  
  1929. FUNCTION Cli : pCommandLineInterface;
  1930. BEGIN
  1931.   ASM
  1932.     MOVE.L  A6,-(A7)
  1933.     MOVEA.L _DOSBase,A6
  1934.     JSR -492(A6)
  1935.     MOVEA.L (A7)+,A6
  1936.     MOVE.L  D0,@RESULT
  1937.   END;
  1938. END;
  1939.  
  1940. FUNCTION CliInitNewcli(dp : pDosPacket) : LONGINT;
  1941. BEGIN
  1942.   ASM
  1943.     MOVE.L  A6,-(A7)
  1944.     MOVEA.L dp,A0
  1945.     MOVEA.L _DOSBase,A6
  1946.     JSR -930(A6)
  1947.     MOVEA.L (A7)+,A6
  1948.     MOVE.L  D0,@RESULT
  1949.   END;
  1950. END;
  1951.  
  1952. FUNCTION CliInitRun(dp : pDosPacket) : LONGINT;
  1953. BEGIN
  1954.   ASM
  1955.     MOVE.L  A6,-(A7)
  1956.     MOVEA.L dp,A0
  1957.     MOVEA.L _DOSBase,A6
  1958.     JSR -936(A6)
  1959.     MOVEA.L (A7)+,A6
  1960.     MOVE.L  D0,@RESULT
  1961.   END;
  1962. END;
  1963.  
  1964. FUNCTION CompareDates(date1 : pDateStamp; date2 : pDateStamp) : LONGINT;
  1965. BEGIN
  1966.   ASM
  1967.     MOVE.L  A6,-(A7)
  1968.     MOVE.L  date1,D1
  1969.     MOVE.L  date2,D2
  1970.     MOVEA.L _DOSBase,A6
  1971.     JSR -738(A6)
  1972.     MOVEA.L (A7)+,A6
  1973.     MOVE.L  D0,@RESULT
  1974.   END;
  1975. END;
  1976.  
  1977. FUNCTION CreateDir(name : pCHAR) : LONGINT;
  1978. BEGIN
  1979.   ASM
  1980.     MOVE.L  A6,-(A7)
  1981.     MOVE.L  name,D1
  1982.     MOVEA.L _DOSBase,A6
  1983.     JSR -120(A6)
  1984.     MOVEA.L (A7)+,A6
  1985.     MOVE.L  D0,@RESULT
  1986.   END;
  1987. END;
  1988.  
  1989. FUNCTION CreateNewProc(tags : pTagItem) : pProcess;
  1990. BEGIN
  1991.   ASM
  1992.     MOVE.L  A6,-(A7)
  1993.     MOVE.L  tags,D1
  1994.     MOVEA.L _DOSBase,A6
  1995.     JSR -498(A6)
  1996.     MOVEA.L (A7)+,A6
  1997.     MOVE.L  D0,@RESULT
  1998.   END;
  1999. END;
  2000.  
  2001. FUNCTION CreateNewProcTagList(tags : pTagItem) : pProcess;
  2002. BEGIN
  2003.   ASM
  2004.     MOVE.L  A6,-(A7)
  2005.     MOVE.L  tags,D1
  2006.     MOVEA.L _DOSBase,A6
  2007.     JSR -498(A6)
  2008.     MOVEA.L (A7)+,A6
  2009.     MOVE.L  D0,@RESULT
  2010.   END;
  2011. END;
  2012.  
  2013. FUNCTION CreateProc(name : pCHAR; pri : LONGINT; segList : LONGINT; stackSize : LONGINT) : pMsgPort;
  2014. BEGIN
  2015.   ASM
  2016.     MOVE.L  A6,-(A7)
  2017.     MOVE.L  name,D1
  2018.     MOVE.L  pri,D2
  2019.     MOVE.L  segList,D3
  2020.     MOVE.L  stackSize,D4
  2021.     MOVEA.L _DOSBase,A6
  2022.     JSR -138(A6)
  2023.     MOVEA.L (A7)+,A6
  2024.     MOVE.L  D0,@RESULT
  2025.   END;
  2026. END;
  2027.  
  2028. FUNCTION CurrentDir(lock : LONGINT) : LONGINT;
  2029. BEGIN
  2030.   ASM
  2031.     MOVE.L  A6,-(A7)
  2032.     MOVE.L  lock,D1
  2033.     MOVEA.L _DOSBase,A6
  2034.     JSR -126(A6)
  2035.     MOVEA.L (A7)+,A6
  2036.     MOVE.L  D0,@RESULT
  2037.   END;
  2038. END;
  2039.  
  2040. PROCEDURE DateStamp(VAR date : pDateStamp);
  2041. BEGIN
  2042.   ASM
  2043.     MOVE.L  A6,-(A7)
  2044.     MOVE.L  date,D1
  2045.     MOVEA.L _DOSBase,A6
  2046.     JSR -192(A6)
  2047.     MOVEA.L (A7)+,A6
  2048.   END;
  2049. END;
  2050.  
  2051. FUNCTION DateToStr(datetime : pDateTime) : BOOLEAN;
  2052. BEGIN
  2053.   ASM
  2054.     MOVE.L  A6,-(A7)
  2055.     MOVE.L  datetime,D1
  2056.     MOVEA.L _DOSBase,A6
  2057.     JSR -744(A6)
  2058.     MOVEA.L (A7)+,A6
  2059.     TST.L   D0
  2060.     BEQ.B   @end
  2061.     MOVEQ   #1,D0
  2062.     @end: MOVE.B  D0,@RESULT
  2063.   END;
  2064. END;
  2065.  
  2066. FUNCTION DeleteFile(name : pCHAR) : BOOLEAN;
  2067. BEGIN
  2068.   ASM
  2069.     MOVE.L  A6,-(A7)
  2070.     MOVE.L  name,D1
  2071.     MOVEA.L _DOSBase,A6
  2072.     JSR -072(A6)
  2073.     MOVEA.L (A7)+,A6
  2074.     TST.L   D0
  2075.     BEQ.B   @end
  2076.     MOVEQ   #1,D0
  2077.     @end: MOVE.B  D0,@RESULT
  2078.   END;
  2079. END;
  2080.  
  2081. FUNCTION DeleteVar(name : pCHAR; flags : ULONG) : BOOLEAN;
  2082. BEGIN
  2083.   ASM
  2084.     MOVE.L  A6,-(A7)
  2085.     MOVE.L  name,D1
  2086.     MOVE.L  flags,D2
  2087.     MOVEA.L _DOSBase,A6
  2088.     JSR -912(A6)
  2089.     MOVEA.L (A7)+,A6
  2090.     TST.L   D0
  2091.     BEQ.B   @end
  2092.     MOVEQ   #1,D0
  2093.     @end: MOVE.B  D0,@RESULT
  2094.   END;
  2095. END;
  2096.  
  2097. FUNCTION DeviceProc(name : pCHAR) : pMsgPort;
  2098. BEGIN
  2099.   ASM
  2100.     MOVE.L  A6,-(A7)
  2101.     MOVE.L  name,D1
  2102.     MOVEA.L _DOSBase,A6
  2103.     JSR -174(A6)
  2104.     MOVEA.L (A7)+,A6
  2105.     MOVE.L  D0,@RESULT
  2106.   END;
  2107. END;
  2108.  
  2109. FUNCTION DoPkt(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT; arg3 : LONGINT; arg4 : LONGINT; arg5 : LONGINT) : LONGINT;
  2110. BEGIN
  2111.   ASM
  2112.     MOVE.L  A6,-(A7)
  2113.     MOVE.L  port,D1
  2114.     MOVE.L  action,D2
  2115.     MOVE.L  arg1,D3
  2116.     MOVE.L  arg2,D4
  2117.     MOVE.L  arg3,D5
  2118.     MOVE.L  arg4,D6
  2119.     MOVE.L  arg5,D7
  2120.     MOVEA.L _DOSBase,A6
  2121.     JSR -240(A6)
  2122.     MOVEA.L (A7)+,A6
  2123.     MOVE.L  D0,@RESULT
  2124.   END;
  2125. END;
  2126.  
  2127. FUNCTION DoPkt0(port : pMsgPort; action : LONGINT) : LONGINT;
  2128. BEGIN
  2129.   ASM
  2130.     MOVE.L  A6,-(A7)
  2131.     MOVE.L  port,D1
  2132.     MOVE.L  action,D2
  2133.     MOVEA.L _DOSBase,A6
  2134.     JSR -240(A6)
  2135.     MOVEA.L (A7)+,A6
  2136.     MOVE.L  D0,@RESULT
  2137.   END;
  2138. END;
  2139.  
  2140. FUNCTION DoPkt1(port : pMsgPort; action : LONGINT; arg1 : LONGINT) : LONGINT;
  2141. BEGIN
  2142.   ASM
  2143.     MOVE.L  A6,-(A7)
  2144.     MOVE.L  port,D1
  2145.     MOVE.L  action,D2
  2146.     MOVE.L  arg1,D3
  2147.     MOVEA.L _DOSBase,A6
  2148.     JSR -240(A6)
  2149.     MOVEA.L (A7)+,A6
  2150.     MOVE.L  D0,@RESULT
  2151.   END;
  2152. END;
  2153.  
  2154. FUNCTION DoPkt2(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT) : LONGINT;
  2155. BEGIN
  2156.   ASM
  2157.     MOVE.L  A6,-(A7)
  2158.     MOVE.L  port,D1
  2159.     MOVE.L  action,D2
  2160.     MOVE.L  arg1,D3
  2161.     MOVE.L  arg2,D4
  2162.     MOVEA.L _DOSBase,A6
  2163.     JSR -240(A6)
  2164.     MOVEA.L (A7)+,A6
  2165.     MOVE.L  D0,@RESULT
  2166.   END;
  2167. END;
  2168.  
  2169. FUNCTION DoPkt3(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT; arg3 : LONGINT) : LONGINT;
  2170. BEGIN
  2171.   ASM
  2172.     MOVE.L  A6,-(A7)
  2173.     MOVE.L  port,D1
  2174.     MOVE.L  action,D2
  2175.     MOVE.L  arg1,D3
  2176.     MOVE.L  arg2,D4
  2177.     MOVE.L  arg3,D5
  2178.     MOVEA.L _DOSBase,A6
  2179.     JSR -240(A6)
  2180.     MOVEA.L (A7)+,A6
  2181.     MOVE.L  D0,@RESULT
  2182.   END;
  2183. END;
  2184.  
  2185. FUNCTION DoPkt4(port : pMsgPort; action : LONGINT; arg1 : LONGINT; arg2 : LONGINT; arg3 : LONGINT; arg4 : LONGINT) : LONGINT;
  2186. BEGIN
  2187.   ASM
  2188.     MOVE.L  A6,-(A7)
  2189.     MOVE.L  port,D1
  2190.     MOVE.L  action,D2
  2191.     MOVE.L  arg1,D3
  2192.     MOVE.L  arg2,D4
  2193.     MOVE.L  arg3,D5
  2194.     MOVE.L  arg4,D6
  2195.     MOVEA.L _DOSBase,A6
  2196.     JSR -240(A6)
  2197.     MOVEA.L (A7)+,A6
  2198.     MOVE.L  D0,@RESULT
  2199.   END;
  2200. END;
  2201.  
  2202. PROCEDURE DOSClose(file_ : LONGINT);
  2203. BEGIN
  2204.   ASM
  2205.     MOVE.L  A6,-(A7)
  2206.     MOVE.L  file_,D1
  2207.     MOVEA.L _DOSBase,A6
  2208.     JSR -036(A6)
  2209.     MOVEA.L (A7)+,A6
  2210.   END;
  2211. END;
  2212.  
  2213. PROCEDURE DOSDelay(timeout : LONGINT);
  2214. BEGIN
  2215.   ASM
  2216.     MOVE.L  A6,-(A7)
  2217.     MOVE.L  timeout,D1
  2218.     MOVEA.L _DOSBase,A6
  2219.     JSR -198(A6)
  2220.     MOVEA.L (A7)+,A6
  2221.   END;
  2222. END;
  2223.  
  2224. PROCEDURE DOSExit(returnCode : LONGINT);
  2225. BEGIN
  2226.   ASM
  2227.     MOVE.L  A6,-(A7)
  2228.     MOVE.L  returnCode,D1
  2229.     MOVEA.L _DOSBase,A6
  2230.     JSR -144(A6)
  2231.     MOVEA.L (A7)+,A6
  2232.   END;
  2233. END;
  2234.  
  2235. FUNCTION DOSFlush(fh : LONGINT) : BOOLEAN;
  2236. BEGIN
  2237.   ASM
  2238.     MOVE.L  A6,-(A7)
  2239.     MOVE.L  fh,D1
  2240.     MOVEA.L _DOSBase,A6
  2241.     JSR -360(A6)
  2242.     MOVEA.L (A7)+,A6
  2243.     TST.L   D0
  2244.     BEQ.B   @end
  2245.     MOVEQ   #1,D0
  2246.     @end: MOVE.B  D0,@RESULT
  2247.   END;
  2248. END;
  2249.  
  2250. FUNCTION DOSInput : LONGINT;
  2251. BEGIN
  2252.   ASM
  2253.     MOVE.L  A6,-(A7)
  2254.     MOVEA.L _DOSBase,A6
  2255.     JSR -054(A6)
  2256.     MOVEA.L (A7)+,A6
  2257.     MOVE.L  D0,@RESULT
  2258.   END;
  2259. END;
  2260.  
  2261. FUNCTION DOSOpen(name : pCHAR; accessMode : LONGINT) : LONGINT;
  2262. BEGIN
  2263.   ASM
  2264.     MOVE.L  A6,-(A7)
  2265.     MOVE.L  name,D1
  2266.     MOVE.L  accessMode,D2
  2267.     MOVEA.L _DOSBase,A6
  2268.     JSR -030(A6)
  2269.     MOVEA.L (A7)+,A6
  2270.     MOVE.L  D0,@RESULT
  2271.   END;
  2272. END;
  2273.  
  2274. FUNCTION DOSOutput : LONGINT;
  2275. BEGIN
  2276.   ASM
  2277.     MOVE.L  A6,-(A7)
  2278.     MOVEA.L _DOSBase,A6
  2279.     JSR -060(A6)
  2280.     MOVEA.L (A7)+,A6
  2281.     MOVE.L  D0,@RESULT
  2282.   END;
  2283. END;
  2284.  
  2285. FUNCTION DOSRead(file_ : LONGINT; buffer : POINTER; length : LONGINT) : LONGINT;
  2286. BEGIN
  2287.   ASM
  2288.     MOVE.L  A6,-(A7)
  2289.     MOVE.L  file_,D1
  2290.     MOVE.L  buffer,D2
  2291.     MOVE.L  length,D3
  2292.     MOVEA.L _DOSBase,A6
  2293.     JSR -042(A6)
  2294.     MOVEA.L (A7)+,A6
  2295.     MOVE.L  D0,@RESULT
  2296.   END;
  2297. END;
  2298.  
  2299. FUNCTION DOSRename(oldName : pCHAR; newName : pCHAR) : LONGINT;
  2300. BEGIN
  2301.   ASM
  2302.     MOVE.L  A6,-(A7)
  2303.     MOVE.L  oldName,D1
  2304.     MOVE.L  newName,D2
  2305.     MOVEA.L _DOSBase,A6
  2306.     JSR -078(A6)
  2307.     MOVEA.L (A7)+,A6
  2308.     MOVE.L  D0,@RESULT
  2309.   END;
  2310. END;
  2311.  
  2312. FUNCTION DOSSeek(file_ : LONGINT; position : LONGINT; offset : LONGINT) : LONGINT;
  2313. BEGIN
  2314.   ASM
  2315.     MOVE.L  A6,-(A7)
  2316.     MOVE.L  file_,D1
  2317.     MOVE.L  position,D2
  2318.     MOVE.L  offset,D3
  2319.     MOVEA.L _DOSBase,A6
  2320.     JSR -066(A6)
  2321.     MOVEA.L (A7)+,A6
  2322.     MOVE.L  D0,@RESULT
  2323.   END;
  2324. END;
  2325.  
  2326. FUNCTION DOSWrite(file_ : LONGINT; buffer : POINTER; length : LONGINT) : LONGINT;
  2327. BEGIN
  2328.   ASM
  2329.     MOVE.L  A6,-(A7)
  2330.     MOVE.L  file_,D1
  2331.     MOVE.L  buffer,D2
  2332.     MOVE.L  length,D3
  2333.     MOVEA.L _DOSBase,A6
  2334.     JSR -048(A6)
  2335.     MOVEA.L (A7)+,A6
  2336.     MOVE.L  D0,@RESULT
  2337.   END;
  2338. END;
  2339.  
  2340. FUNCTION DupLock(lock : LONGINT) : LONGINT;
  2341. BEGIN
  2342.   ASM
  2343.     MOVE.L  A6,-(A7)
  2344.     MOVE.L  lock,D1
  2345.     MOVEA.L _DOSBase,A6
  2346.     JSR -096(A6)
  2347.     MOVEA.L (A7)+,A6
  2348.     MOVE.L  D0,@RESULT
  2349.   END;
  2350. END;
  2351.  
  2352. FUNCTION DupLockFromFH(fh : LONGINT) : LONGINT;
  2353. BEGIN
  2354.   ASM
  2355.     MOVE.L  A6,-(A7)
  2356.     MOVE.L  fh,D1
  2357.     MOVEA.L _DOSBase,A6
  2358.     JSR -372(A6)
  2359.     MOVEA.L (A7)+,A6
  2360.     MOVE.L  D0,@RESULT
  2361.   END;
  2362. END;
  2363.  
  2364. PROCEDURE EndNotify(notify : pNotifyRequest);
  2365. BEGIN
  2366.   ASM
  2367.     MOVE.L  A6,-(A7)
  2368.     MOVE.L  notify,D1
  2369.     MOVEA.L _DOSBase,A6
  2370.     JSR -894(A6)
  2371.     MOVEA.L (A7)+,A6
  2372.   END;
  2373. END;
  2374.  
  2375. FUNCTION ErrorReport(code : LONGINT; type_ : LONGINT; arg1 : ULONG; device : pMsgPort) : BOOLEAN;
  2376. BEGIN
  2377.   ASM
  2378.     MOVE.L  A6,-(A7)
  2379.     MOVE.L  code,D1
  2380.     MOVE.L  type_,D2
  2381.     MOVE.L  arg1,D3
  2382.     MOVE.L  device,D4
  2383.     MOVEA.L _DOSBase,A6
  2384.     JSR -480(A6)
  2385.     MOVEA.L (A7)+,A6
  2386.     TST.L   D0
  2387.     BEQ.B   @end
  2388.     MOVEQ   #1,D0
  2389.     @end: MOVE.B  D0,@RESULT
  2390.   END;
  2391. END;
  2392.  
  2393. FUNCTION ExAll(lock : LONGINT; buffer : pExAllData; size : LONGINT; data : LONGINT; control : pExAllControl) : BOOLEAN;
  2394. BEGIN
  2395.   ASM
  2396.     MOVE.L  A6,-(A7)
  2397.     MOVE.L  lock,D1
  2398.     MOVE.L  buffer,D2
  2399.     MOVE.L  size,D3
  2400.     MOVE.L  data,D4
  2401.     MOVE.L  control,D5
  2402.     MOVEA.L _DOSBase,A6
  2403.     JSR -432(A6)
  2404.     MOVEA.L (A7)+,A6
  2405.     TST.L   D0
  2406.     BEQ.B   @end
  2407.     MOVEQ   #1,D0
  2408.     @end: MOVE.B  D0,@RESULT
  2409.   END;
  2410. END;
  2411.  
  2412. PROCEDURE ExAllEnd(lock : LONGINT; buffer : pExAllData; size : LONGINT; data : LONGINT; control : pExAllControl);
  2413. BEGIN
  2414.   ASM
  2415.     MOVE.L  A6,-(A7)
  2416.     MOVE.L  lock,D1
  2417.     MOVE.L  buffer,D2
  2418.     MOVE.L  size,D3
  2419.     MOVE.L  data,D4
  2420.     MOVE.L  control,D5
  2421.     MOVEA.L _DOSBase,A6
  2422.     JSR -990(A6)
  2423.     MOVEA.L (A7)+,A6
  2424.   END;
  2425. END;
  2426.  
  2427. FUNCTION Examine(lock : LONGINT; fileInfoBlock : pFileInfoBlock) : BOOLEAN;
  2428. BEGIN
  2429.   ASM
  2430.     MOVE.L  A6,-(A7)
  2431.     MOVE.L  lock,D1
  2432.     MOVE.L  fileInfoBlock,D2
  2433.     MOVEA.L _DOSBase,A6
  2434.     JSR -102(A6)
  2435.     MOVEA.L (A7)+,A6
  2436.     TST.L   D0
  2437.     BEQ.B   @end
  2438.     MOVEQ   #1,D0
  2439.     @end: MOVE.B  D0,@RESULT
  2440.   END;
  2441. END;
  2442.  
  2443. FUNCTION ExamineFH(fh : LONGINT; fib : pFileInfoBlock) : BOOLEAN;
  2444. BEGIN
  2445.   ASM
  2446.     MOVE.L  A6,-(A7)
  2447.     MOVE.L  fh,D1
  2448.     MOVE.L  fib,D2
  2449.     MOVEA.L _DOSBase,A6
  2450.     JSR -390(A6)
  2451.     MOVEA.L (A7)+,A6
  2452.     TST.W   D0
  2453.     BEQ.B   @end
  2454.     MOVEQ   #1,D0
  2455.   @end: MOVE.B  D0,@RESULT
  2456.   END;
  2457. END;
  2458.  
  2459. FUNCTION Execute(string_ : pCHAR; file_ : LONGINT; file2 : LONGINT) : BOOLEAN;
  2460. BEGIN
  2461.   ASM
  2462.     MOVE.L  A6,-(A7)
  2463.     MOVE.L  string_,D1
  2464.     MOVE.L  file_,D2
  2465.     MOVE.L  file2,D3
  2466.     MOVEA.L _DOSBase,A6
  2467.     JSR -222(A6)
  2468.     MOVEA.L (A7)+,A6
  2469.     TST.L   D0
  2470.     BEQ.B   @end
  2471.     MOVEQ   #1,D0
  2472.     @end: MOVE.B  D0,@RESULT
  2473.   END;
  2474. END;
  2475.  
  2476. FUNCTION ExNext(lock : LONGINT; fileInfoBlock : pFileInfoBlock) : BOOLEAN;
  2477. BEGIN
  2478.   ASM
  2479.     MOVE.L  A6,-(A7)
  2480.     MOVE.L  lock,D1
  2481.     MOVE.L  fileInfoBlock,D2
  2482.     MOVEA.L _DOSBase,A6
  2483.     JSR -108(A6)
  2484.     MOVEA.L (A7)+,A6
  2485.     TST.L   D0
  2486.     BEQ.B   @end
  2487.     MOVEQ   #1,D0
  2488.     @end: MOVE.B  D0,@RESULT
  2489.   END;
  2490. END;
  2491.  
  2492. FUNCTION Fault(code : LONGINT; header : pCHAR; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  2493. BEGIN
  2494.   ASM
  2495.     MOVE.L  A6,-(A7)
  2496.     MOVE.L  code,D1
  2497.     MOVE.L  header,D2
  2498.     MOVE.L  buffer,D3
  2499.     MOVE.L  len,D4
  2500.     MOVEA.L _DOSBase,A6
  2501.     JSR -468(A6)
  2502.     MOVEA.L (A7)+,A6
  2503.     TST.W   D0
  2504.     BEQ.B   @end
  2505.     MOVEQ   #1,D0
  2506.   @end: MOVE.B  D0,@RESULT
  2507.   END;
  2508. END;
  2509.  
  2510. FUNCTION FGetC(fh : LONGINT) : LONGINT;
  2511. BEGIN
  2512.   ASM
  2513.     MOVE.L  A6,-(A7)
  2514.     MOVE.L  fh,D1
  2515.     MOVEA.L _DOSBase,A6
  2516.     JSR -306(A6)
  2517.     MOVEA.L (A7)+,A6
  2518.     MOVE.L  D0,@RESULT
  2519.   END;
  2520. END;
  2521.  
  2522. FUNCTION FGets(fh : LONGINT; buf : pCHAR; buflen : ULONG) : pCHAR;
  2523. BEGIN
  2524.   ASM
  2525.     MOVE.L  A6,-(A7)
  2526.     MOVE.L  fh,D1
  2527.     MOVE.L  buf,D2
  2528.     MOVE.L  buflen,D3
  2529.     MOVEA.L _DOSBase,A6
  2530.     JSR -336(A6)
  2531.     MOVEA.L (A7)+,A6
  2532.     MOVE.L  D0,@RESULT
  2533.   END;
  2534. END;
  2535.  
  2536. FUNCTION FilePart(path : pCHAR) : pCHAR;
  2537. BEGIN
  2538.   ASM
  2539.     MOVE.L  A6,-(A7)
  2540.     MOVE.L  path,D1
  2541.     MOVEA.L _DOSBase,A6
  2542.     JSR -870(A6)
  2543.     MOVEA.L (A7)+,A6
  2544.     MOVE.L  D0,@RESULT
  2545.   END;
  2546. END;
  2547.  
  2548. FUNCTION FindArg(keyword : pCHAR; arg_template : pCHAR) : LONGINT;
  2549. BEGIN
  2550.   ASM
  2551.     MOVE.L  A6,-(A7)
  2552.     MOVE.L  keyword,D1
  2553.     MOVE.L  arg_template,D2
  2554.     MOVEA.L _DOSBase,A6
  2555.     JSR -804(A6)
  2556.     MOVEA.L (A7)+,A6
  2557.     MOVE.L  D0,@RESULT
  2558.   END;
  2559. END;
  2560.  
  2561. FUNCTION FindCliProc(num : ULONG) : pProcess;
  2562. BEGIN
  2563.   ASM
  2564.     MOVE.L  A6,-(A7)
  2565.     MOVE.L  num,D1
  2566.     MOVEA.L _DOSBase,A6
  2567.     JSR -546(A6)
  2568.     MOVEA.L (A7)+,A6
  2569.     MOVE.L  D0,@RESULT
  2570.   END;
  2571. END;
  2572.  
  2573. FUNCTION FindDosEntry(dlist : pDosList; name : pCHAR; flags : ULONG) : pDosList;
  2574. BEGIN
  2575.   ASM
  2576.     MOVE.L  A6,-(A7)
  2577.     MOVE.L  dlist,D1
  2578.     MOVE.L  name,D2
  2579.     MOVE.L  flags,D3
  2580.     MOVEA.L _DOSBase,A6
  2581.     JSR -684(A6)
  2582.     MOVEA.L (A7)+,A6
  2583.     MOVE.L  D0,@RESULT
  2584.   END;
  2585. END;
  2586.  
  2587. FUNCTION FindSegment(name : pCHAR; seg : pSegment; system : LONGINT) : pSegment;
  2588. BEGIN
  2589.   ASM
  2590.     MOVE.L  A6,-(A7)
  2591.     MOVE.L  name,D1
  2592.     MOVE.L  seg,D2
  2593.     MOVE.L  system,D3
  2594.     MOVEA.L _DOSBase,A6
  2595.     JSR -780(A6)
  2596.     MOVEA.L (A7)+,A6
  2597.     MOVE.L  D0,@RESULT
  2598.   END;
  2599. END;
  2600.  
  2601. FUNCTION FindVar(name : pCHAR; type_ : ULONG) : pLocalVar;
  2602. BEGIN
  2603.   ASM
  2604.     MOVE.L  A6,-(A7)
  2605.     MOVE.L  name,D1
  2606.     MOVE.L  type_,D2
  2607.     MOVEA.L _DOSBase,A6
  2608.     JSR -918(A6)
  2609.     MOVEA.L (A7)+,A6
  2610.     MOVE.L  D0,@RESULT
  2611.   END;
  2612. END;
  2613.  
  2614. FUNCTION Format(filesystem : pCHAR; volumename : pCHAR; dostype : ULONG) : BOOLEAN;
  2615. BEGIN
  2616.   ASM
  2617.     MOVE.L  A6,-(A7)
  2618.     MOVE.L  filesystem,D1
  2619.     MOVE.L  volumename,D2
  2620.     MOVE.L  dostype,D3
  2621.     MOVEA.L _DOSBase,A6
  2622.     JSR -714(A6)
  2623.     MOVEA.L (A7)+,A6
  2624.     TST.W   D0
  2625.     BEQ.B   @end
  2626.     MOVEQ   #1,D0
  2627.   @end: MOVE.B  D0,@RESULT
  2628.   END;
  2629. END;
  2630.  
  2631. FUNCTION FPutC(fh : LONGINT; ch : LONGINT) : LONGINT;
  2632. BEGIN
  2633.   ASM
  2634.     MOVE.L  A6,-(A7)
  2635.     MOVE.L  fh,D1
  2636.     MOVE.L  ch,D2
  2637.     MOVEA.L _DOSBase,A6
  2638.     JSR -312(A6)
  2639.     MOVEA.L (A7)+,A6
  2640.     MOVE.L  D0,@RESULT
  2641.   END;
  2642. END;
  2643.  
  2644. FUNCTION FPuts(fh : LONGINT; str : pCHAR) : BOOLEAN;
  2645. BEGIN
  2646.   ASM
  2647.     MOVE.L  A6,-(A7)
  2648.     MOVE.L  fh,D1
  2649.     MOVE.L  str,D2
  2650.     MOVEA.L _DOSBase,A6
  2651.     JSR -342(A6)
  2652.     MOVEA.L (A7)+,A6
  2653.     TST.L   D0
  2654.     BEQ.B   @end
  2655.     MOVEQ   #1,D0
  2656.     @end: MOVE.B  D0,@RESULT
  2657.   END;
  2658. END;
  2659.  
  2660. FUNCTION FRead(fh : LONGINT; block : POINTER; blocklen : ULONG; number : ULONG) : LONGINT;
  2661. BEGIN
  2662.   ASM
  2663.     MOVE.L  A6,-(A7)
  2664.     MOVE.L  fh,D1
  2665.     MOVE.L  block,D2
  2666.     MOVE.L  blocklen,D3
  2667.     MOVE.L  number,D4
  2668.     MOVEA.L _DOSBase,A6
  2669.     JSR -324(A6)
  2670.     MOVEA.L (A7)+,A6
  2671.     MOVE.L  D0,@RESULT
  2672.   END;
  2673. END;
  2674.  
  2675. PROCEDURE FreeArgs(args : pRDArgs);
  2676. BEGIN
  2677.   ASM
  2678.     MOVE.L  A6,-(A7)
  2679.     MOVE.L  args,D1
  2680.     MOVEA.L _DOSBase,A6
  2681.     JSR -858(A6)
  2682.     MOVEA.L (A7)+,A6
  2683.   END;
  2684. END;
  2685.  
  2686. PROCEDURE FreeDeviceProc(dp : pDevProc);
  2687. BEGIN
  2688.   ASM
  2689.     MOVE.L  A6,-(A7)
  2690.     MOVE.L  dp,D1
  2691.     MOVEA.L _DOSBase,A6
  2692.     JSR -648(A6)
  2693.     MOVEA.L (A7)+,A6
  2694.   END;
  2695. END;
  2696.  
  2697. PROCEDURE FreeDosEntry(dlist : pDosList);
  2698. BEGIN
  2699.   ASM
  2700.     MOVE.L  A6,-(A7)
  2701.     MOVE.L  dlist,D1
  2702.     MOVEA.L _DOSBase,A6
  2703.     JSR -702(A6)
  2704.     MOVEA.L (A7)+,A6
  2705.   END;
  2706. END;
  2707.  
  2708. PROCEDURE FreeDosObject(type_ : ULONG; ptr : POINTER);
  2709. BEGIN
  2710.   ASM
  2711.     MOVE.L  A6,-(A7)
  2712.     MOVE.L  type_,D1
  2713.     MOVE.L  ptr,D2
  2714.     MOVEA.L _DOSBase,A6
  2715.     JSR -234(A6)
  2716.     MOVEA.L (A7)+,A6
  2717.   END;
  2718. END;
  2719.  
  2720. FUNCTION FWrite(fh : LONGINT; block : POINTER; blocklen : ULONG; number : ULONG) : LONGINT;
  2721. BEGIN
  2722.   ASM
  2723.     MOVE.L  A6,-(A7)
  2724.     MOVE.L  fh,D1
  2725.     MOVE.L  block,D2
  2726.     MOVE.L  blocklen,D3
  2727.     MOVE.L  number,D4
  2728.     MOVEA.L _DOSBase,A6
  2729.     JSR -330(A6)
  2730.     MOVEA.L (A7)+,A6
  2731.     MOVE.L  D0,@RESULT
  2732.   END;
  2733. END;
  2734.  
  2735. FUNCTION GetArgStr : pCHAR;
  2736. BEGIN
  2737.   ASM
  2738.     MOVE.L  A6,-(A7)
  2739.     MOVEA.L _DOSBase,A6
  2740.     JSR -534(A6)
  2741.     MOVEA.L (A7)+,A6
  2742.     MOVE.L  D0,@RESULT
  2743.   END;
  2744. END;
  2745.  
  2746. FUNCTION GetConsoleTask : pMsgPort;
  2747. BEGIN
  2748.   ASM
  2749.     MOVE.L  A6,-(A7)
  2750.     MOVEA.L _DOSBase,A6
  2751.     JSR -510(A6)
  2752.     MOVEA.L (A7)+,A6
  2753.     MOVE.L  D0,@RESULT
  2754.   END;
  2755. END;
  2756.  
  2757. FUNCTION GetCurrentDirName(buf : pCHAR; len : LONGINT) : BOOLEAN;
  2758. BEGIN
  2759.   ASM
  2760.     MOVE.L  A6,-(A7)
  2761.     MOVE.L  buf,D1
  2762.     MOVE.L  len,D2
  2763.     MOVEA.L _DOSBase,A6
  2764.     JSR -564(A6)
  2765.     MOVEA.L (A7)+,A6
  2766.     TST.W   D0
  2767.     BEQ.B   @end
  2768.     MOVEQ   #1,D0
  2769.   @end: MOVE.B  D0,@RESULT
  2770.   END;
  2771. END;
  2772.  
  2773. FUNCTION GetDeviceProc(name : pCHAR; dp : pDevProc) : pDevProc;
  2774. BEGIN
  2775.   ASM
  2776.     MOVE.L  A6,-(A7)
  2777.     MOVE.L  name,D1
  2778.     MOVE.L  dp,D2
  2779.     MOVEA.L _DOSBase,A6
  2780.     JSR -642(A6)
  2781.     MOVEA.L (A7)+,A6
  2782.     MOVE.L  D0,@RESULT
  2783.   END;
  2784. END;
  2785.  
  2786. FUNCTION GetFileSysTask : pMsgPort;
  2787. BEGIN
  2788.   ASM
  2789.     MOVE.L  A6,-(A7)
  2790.     MOVEA.L _DOSBase,A6
  2791.     JSR -522(A6)
  2792.     MOVEA.L (A7)+,A6
  2793.     MOVE.L  D0,@RESULT
  2794.   END;
  2795. END;
  2796.  
  2797. FUNCTION GetProgramDir : LONGINT;
  2798. BEGIN
  2799.   ASM
  2800.     MOVE.L  A6,-(A7)
  2801.     MOVEA.L _DOSBase,A6
  2802.     JSR -600(A6)
  2803.     MOVEA.L (A7)+,A6
  2804.     MOVE.L  D0,@RESULT
  2805.   END;
  2806. END;
  2807.  
  2808. FUNCTION GetProgramName(buf : pCHAR; len : LONGINT) : BOOLEAN;
  2809. BEGIN
  2810.   ASM
  2811.     MOVE.L  A6,-(A7)
  2812.     MOVE.L  buf,D1
  2813.     MOVE.L  len,D2
  2814.     MOVEA.L _DOSBase,A6
  2815.     JSR -576(A6)
  2816.     MOVEA.L (A7)+,A6
  2817.     TST.W   D0
  2818.     BEQ.B   @end
  2819.     MOVEQ   #1,D0
  2820.   @end: MOVE.B  D0,@RESULT
  2821.   END;
  2822. END;
  2823.  
  2824. FUNCTION GetPrompt(buf : pCHAR; len : LONGINT) : BOOLEAN;
  2825. BEGIN
  2826.   ASM
  2827.     MOVE.L  A6,-(A7)
  2828.     MOVE.L  buf,D1
  2829.     MOVE.L  len,D2
  2830.     MOVEA.L _DOSBase,A6
  2831.     JSR -588(A6)
  2832.     MOVEA.L (A7)+,A6
  2833.     TST.W   D0
  2834.     BEQ.B   @end
  2835.     MOVEQ   #1,D0
  2836.   @end: MOVE.B  D0,@RESULT
  2837.   END;
  2838. END;
  2839.  
  2840. FUNCTION GetVar(name : pCHAR; buffer : pCHAR; size : LONGINT; flags : LONGINT) : LONGINT;
  2841. BEGIN
  2842.   ASM
  2843.     MOVE.L  A6,-(A7)
  2844.     MOVE.L  name,D1
  2845.     MOVE.L  buffer,D2
  2846.     MOVE.L  size,D3
  2847.     MOVE.L  flags,D4
  2848.     MOVEA.L _DOSBase,A6
  2849.     JSR -906(A6)
  2850.     MOVEA.L (A7)+,A6
  2851.     MOVE.L  D0,@RESULT
  2852.   END;
  2853. END;
  2854.  
  2855. FUNCTION Info(lock : LONGINT; parameterBlock : pInfoData) : BOOLEAN;
  2856. BEGIN
  2857.   ASM
  2858.     MOVE.L  A6,-(A7)
  2859.     MOVE.L  lock,D1
  2860.     MOVE.L  parameterBlock,D2
  2861.     MOVEA.L _DOSBase,A6
  2862.     JSR -114(A6)
  2863.     MOVEA.L (A7)+,A6
  2864.     TST.L   D0
  2865.     BEQ.B   @end
  2866.     MOVEQ   #1,D0
  2867.     @end: MOVE.B  D0,@RESULT
  2868.   END;
  2869. END;
  2870.  
  2871. FUNCTION Inhibit(name : pCHAR; onoff : LONGINT) : BOOLEAN;
  2872. BEGIN
  2873.   ASM
  2874.     MOVE.L  A6,-(A7)
  2875.     MOVE.L  name,D1
  2876.     MOVE.L  onoff,D2
  2877.     MOVEA.L _DOSBase,A6
  2878.     JSR -726(A6)
  2879.     MOVEA.L (A7)+,A6
  2880.     TST.L   D0
  2881.     BEQ.B   @end
  2882.     MOVEQ   #1,D0
  2883.     @end: MOVE.B  D0,@RESULT
  2884.   END;
  2885. END;
  2886.  
  2887. FUNCTION InternalLoadSeg(fh : LONGINT; table : LONGINT; VAR funcarray : LONGINT; VAR stack : LONGINT) : LONGINT;
  2888. BEGIN
  2889.   ASM
  2890.     MOVE.L  A6,-(A7)
  2891.     MOVE.L  fh,D0
  2892.     MOVEA.L table,A0
  2893.     MOVEA.L funcarray,A1
  2894.     MOVEA.L stack,A2
  2895.     MOVEA.L _DOSBase,A6
  2896.     JSR -756(A6)
  2897.     MOVEA.L (A7)+,A6
  2898.     MOVE.L  D0,@RESULT
  2899.   END;
  2900. END;
  2901.  
  2902. FUNCTION InternalUnLoadSeg(seglist : LONGINT; freefunc : tPROCEDURE) : BOOLEAN;
  2903. BEGIN
  2904.   ASM
  2905.     MOVE.L  A6,-(A7)
  2906.     MOVE.L  seglist,D1
  2907.     MOVEA.L freefunc,A1
  2908.     MOVEA.L _DOSBase,A6
  2909.     JSR -762(A6)
  2910.     MOVEA.L (A7)+,A6
  2911.     TST.W   D0
  2912.     BEQ.B   @end
  2913.     MOVEQ   #1,D0
  2914.   @end: MOVE.B  D0,@RESULT
  2915.   END;
  2916. END;
  2917.  
  2918. FUNCTION IoErr : LONGINT;
  2919. BEGIN
  2920.   ASM
  2921.     MOVE.L  A6,-(A7)
  2922.     MOVEA.L _DOSBase,A6
  2923.     JSR -132(A6)
  2924.     MOVEA.L (A7)+,A6
  2925.     MOVE.L  D0,@RESULT
  2926.   END;
  2927. END;
  2928.  
  2929. FUNCTION IsFileSystem(name : pCHAR) : BOOLEAN;
  2930. BEGIN
  2931.   ASM
  2932.     MOVE.L  A6,-(A7)
  2933.     MOVE.L  name,D1
  2934.     MOVEA.L _DOSBase,A6
  2935.     JSR -708(A6)
  2936.     MOVEA.L (A7)+,A6
  2937.     TST.W   D0
  2938.     BEQ.B   @end
  2939.     MOVEQ   #1,D0
  2940.   @end: MOVE.B  D0,@RESULT
  2941.   END;
  2942. END;
  2943.  
  2944. FUNCTION IsInteractive(file_ : LONGINT) : BOOLEAN;
  2945. BEGIN
  2946.   ASM
  2947.     MOVE.L  A6,-(A7)
  2948.     MOVE.L  file_,D1
  2949.     MOVEA.L _DOSBase,A6
  2950.     JSR -216(A6)
  2951.     MOVEA.L (A7)+,A6
  2952.     TST.L   D0
  2953.     BEQ.B   @end
  2954.     MOVEQ   #1,D0
  2955.     @end: MOVE.B  D0,@RESULT
  2956.   END;
  2957. END;
  2958.  
  2959. FUNCTION LoadSeg(name : pCHAR) : LONGINT;
  2960. BEGIN
  2961.   ASM
  2962.     MOVE.L  A6,-(A7)
  2963.     MOVE.L  name,D1
  2964.     MOVEA.L _DOSBase,A6
  2965.     JSR -150(A6)
  2966.     MOVEA.L (A7)+,A6
  2967.     MOVE.L  D0,@RESULT
  2968.   END;
  2969. END;
  2970.  
  2971. FUNCTION Lock(name : pCHAR; type_ : LONGINT) : LONGINT;
  2972. BEGIN
  2973.   ASM
  2974.     MOVE.L  A6,-(A7)
  2975.     MOVE.L  name,D1
  2976.     MOVE.L  type_,D2
  2977.     MOVEA.L _DOSBase,A6
  2978.     JSR -084(A6)
  2979.     MOVEA.L (A7)+,A6
  2980.     MOVE.L  D0,@RESULT
  2981.   END;
  2982. END;
  2983.  
  2984. FUNCTION LockDosList(flags : ULONG) : pDosList;
  2985. BEGIN
  2986.   ASM
  2987.     MOVE.L  A6,-(A7)
  2988.     MOVE.L  flags,D1
  2989.     MOVEA.L _DOSBase,A6
  2990.     JSR -654(A6)
  2991.     MOVEA.L (A7)+,A6
  2992.     MOVE.L  D0,@RESULT
  2993.   END;
  2994. END;
  2995.  
  2996. FUNCTION LockRecord(fh : LONGINT; offset : ULONG; length : ULONG; mode : ULONG; timeout : ULONG) : BOOLEAN;
  2997. BEGIN
  2998.   ASM
  2999.     MOVE.L  A6,-(A7)
  3000.     MOVE.L  fh,D1
  3001.     MOVE.L  offset,D2
  3002.     MOVE.L  length,D3
  3003.     MOVE.L  mode,D4
  3004.     MOVE.L  timeout,D5
  3005.     MOVEA.L _DOSBase,A6
  3006.     JSR -270(A6)
  3007.     MOVEA.L (A7)+,A6
  3008.     TST.W   D0
  3009.     BEQ.B   @end
  3010.     MOVEQ   #1,D0
  3011.   @end: MOVE.B  D0,@RESULT
  3012.   END;
  3013. END;
  3014.  
  3015. FUNCTION LockRecords(recArray : pRecordLock; timeout : ULONG) : BOOLEAN;
  3016. BEGIN
  3017.   ASM
  3018.     MOVE.L  A6,-(A7)
  3019.     MOVE.L  recArray,D1
  3020.     MOVE.L  timeout,D2
  3021.     MOVEA.L _DOSBase,A6
  3022.     JSR -276(A6)
  3023.     MOVEA.L (A7)+,A6
  3024.     TST.W   D0
  3025.     BEQ.B   @end
  3026.     MOVEQ   #1,D0
  3027.   @end: MOVE.B  D0,@RESULT
  3028.   END;
  3029. END;
  3030.  
  3031. FUNCTION MakeDosEntry(name : pCHAR; type_ : LONGINT) : pDosList;
  3032. BEGIN
  3033.   ASM
  3034.     MOVE.L  A6,-(A7)
  3035.     MOVE.L  name,D1
  3036.     MOVE.L  type_,D2
  3037.     MOVEA.L _DOSBase,A6
  3038.     JSR -696(A6)
  3039.     MOVEA.L (A7)+,A6
  3040.     MOVE.L  D0,@RESULT
  3041.   END;
  3042. END;
  3043.  
  3044. FUNCTION MakeLink(name : pCHAR; dest : LONGINT; soft : LONGINT) : BOOLEAN;
  3045. BEGIN
  3046.   ASM
  3047.     MOVE.L  A6,-(A7)
  3048.     MOVE.L  name,D1
  3049.     MOVE.L  dest,D2
  3050.     MOVE.L  soft,D3
  3051.     MOVEA.L _DOSBase,A6
  3052.     JSR -444(A6)
  3053.     MOVEA.L (A7)+,A6
  3054.     TST.L   D0
  3055.     BEQ.B   @end
  3056.     MOVEQ   #1,D0
  3057.     @end: MOVE.B  D0,@RESULT
  3058.   END;
  3059. END;
  3060.  
  3061. PROCEDURE MatchEnd(anchor : pAnchorPath);
  3062. BEGIN
  3063.   ASM
  3064.     MOVE.L  A6,-(A7)
  3065.     MOVE.L  anchor,D1
  3066.     MOVEA.L _DOSBase,A6
  3067.     JSR -834(A6)
  3068.     MOVEA.L (A7)+,A6
  3069.   END;
  3070. END;
  3071.  
  3072. FUNCTION MatchFirst(pat : pCHAR; anchor : pAnchorPath) : LONGINT;
  3073. BEGIN
  3074.   ASM
  3075.     MOVE.L  A6,-(A7)
  3076.     MOVE.L  pat,D1
  3077.     MOVE.L  anchor,D2
  3078.     MOVEA.L _DOSBase,A6
  3079.     JSR -822(A6)
  3080.     MOVEA.L (A7)+,A6
  3081.     MOVE.L  D0,@RESULT
  3082.   END;
  3083. END;
  3084.  
  3085. FUNCTION MatchNext(anchor : pAnchorPath) : LONGINT;
  3086. BEGIN
  3087.   ASM
  3088.     MOVE.L  A6,-(A7)
  3089.     MOVE.L  anchor,D1
  3090.     MOVEA.L _DOSBase,A6
  3091.     JSR -828(A6)
  3092.     MOVEA.L (A7)+,A6
  3093.     MOVE.L  D0,@RESULT
  3094.   END;
  3095. END;
  3096.  
  3097. FUNCTION MatchPattern(pat : pCHAR; str : pCHAR) : BOOLEAN;
  3098. BEGIN
  3099.   ASM
  3100.     MOVE.L  A6,-(A7)
  3101.     MOVE.L  pat,D1
  3102.     MOVE.L  str,D2
  3103.     MOVEA.L _DOSBase,A6
  3104.     JSR -846(A6)
  3105.     MOVEA.L (A7)+,A6
  3106.     TST.W   D0
  3107.     BEQ.B   @end
  3108.     MOVEQ   #1,D0
  3109.   @end: MOVE.B  D0,@RESULT
  3110.   END;
  3111. END;
  3112.  
  3113. FUNCTION MatchPatternNoCase(pat : pCHAR; str : pCHAR) : BOOLEAN;
  3114. BEGIN
  3115.   ASM
  3116.     MOVE.L  A6,-(A7)
  3117.     MOVE.L  pat,D1
  3118.     MOVE.L  str,D2
  3119.     MOVEA.L _DOSBase,A6
  3120.     JSR -972(A6)
  3121.     MOVEA.L (A7)+,A6
  3122.     TST.W   D0
  3123.     BEQ.B   @end
  3124.     MOVEQ   #1,D0
  3125.   @end: MOVE.B  D0,@RESULT
  3126.   END;
  3127. END;
  3128.  
  3129. FUNCTION MaxCli : ULONG;
  3130. BEGIN
  3131.   ASM
  3132.     MOVE.L  A6,-(A7)
  3133.     MOVEA.L _DOSBase,A6
  3134.     JSR -552(A6)
  3135.     MOVEA.L (A7)+,A6
  3136.     MOVE.L  D0,@RESULT
  3137.   END;
  3138. END;
  3139.  
  3140. FUNCTION NameFromFH(fh : LONGINT; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  3141. BEGIN
  3142.   ASM
  3143.     MOVE.L  A6,-(A7)
  3144.     MOVE.L  fh,D1
  3145.     MOVE.L  buffer,D2
  3146.     MOVE.L  len,D3
  3147.     MOVEA.L _DOSBase,A6
  3148.     JSR -408(A6)
  3149.     MOVEA.L (A7)+,A6
  3150.     TST.L   D0
  3151.     BEQ.B   @end
  3152.     MOVEQ   #1,D0
  3153.     @end: MOVE.B  D0,@RESULT
  3154.   END;
  3155. END;
  3156.  
  3157. FUNCTION NameFromLock(lock : LONGINT; buffer : pCHAR; len : LONGINT) : BOOLEAN;
  3158. BEGIN
  3159.   ASM
  3160.     MOVE.L  A6,-(A7)
  3161.     MOVE.L  lock,D1
  3162.     MOVE.L  buffer,D2
  3163.     MOVE.L  len,D3
  3164.     MOVEA.L _DOSBase,A6
  3165.     JSR -402(A6)
  3166.     MOVEA.L (A7)+,A6
  3167.     TST.L   D0
  3168.     BEQ.B   @end
  3169.     MOVEQ   #1,D0
  3170.     @end: MOVE.B  D0,@RESULT
  3171.   END;
  3172. END;
  3173.  
  3174. FUNCTION NewLoadSeg(file_ : pCHAR; tags : pTagItem) : LONGINT;
  3175. BEGIN
  3176.   ASM
  3177.     MOVE.L  A6,-(A7)
  3178.     MOVE.L  file_,D1
  3179.     MOVE.L  tags,D2
  3180.     MOVEA.L _DOSBase,A6
  3181.     JSR -768(A6)
  3182.     MOVEA.L (A7)+,A6
  3183.     MOVE.L  D0,@RESULT
  3184.   END;
  3185. END;
  3186.  
  3187. FUNCTION NewLoadSegTagList(file_ : pCHAR; tags : pTagItem) : LONGINT;
  3188. BEGIN
  3189.   ASM
  3190.     MOVE.L  A6,-(A7)
  3191.     MOVE.L  file_,D1
  3192.     MOVE.L  tags,D2
  3193.     MOVEA.L _DOSBase,A6
  3194.     JSR -768(A6)
  3195.     MOVEA.L (A7)+,A6
  3196.     MOVE.L  D0,@RESULT
  3197.   END;
  3198. END;
  3199.  
  3200. FUNCTION NextDosEntry(dlist : pDosList; flags : ULONG) : pDosList;
  3201. BEGIN
  3202.   ASM
  3203.     MOVE.L  A6,-(A7)
  3204.     MOVE.L  dlist,D1
  3205.     MOVE.L  flags,D2
  3206.     MOVEA.L _DOSBase,A6
  3207.     JSR -690(A6)
  3208.     MOVEA.L (A7)+,A6
  3209.     MOVE.L  D0,@RESULT
  3210.   END;
  3211. END;
  3212.  
  3213. FUNCTION OpenFromLock(lock : LONGINT) : LONGINT;
  3214. BEGIN
  3215.   ASM
  3216.     MOVE.L  A6,-(A7)
  3217.     MOVE.L  lock,D1
  3218.     MOVEA.L _DOSBase,A6
  3219.     JSR -378(A6)
  3220.     MOVEA.L (A7)+,A6
  3221.     MOVE.L  D0,@RESULT
  3222.   END;
  3223. END;
  3224.  
  3225. FUNCTION ParentDir(lock : LONGINT) : LONGINT;
  3226. BEGIN
  3227.   ASM
  3228.     MOVE.L  A6,-(A7)
  3229.     MOVE.L  lock,D1
  3230.     MOVEA.L _DOSBase,A6
  3231.     JSR -210(A6)
  3232.     MOVEA.L (A7)+,A6
  3233.     MOVE.L  D0,@RESULT
  3234.   END;
  3235. END;
  3236.  
  3237. FUNCTION ParentOfFH(fh : LONGINT) : LONGINT;
  3238. BEGIN
  3239.   ASM
  3240.     MOVE.L  A6,-(A7)
  3241.     MOVE.L  fh,D1
  3242.     MOVEA.L _DOSBase,A6
  3243.     JSR -384(A6)
  3244.     MOVEA.L (A7)+,A6
  3245.     MOVE.L  D0,@RESULT
  3246.   END;
  3247. END;
  3248.  
  3249. FUNCTION ParsePattern(pat : pCHAR; buf : pCHAR; buflen : LONGINT) : LONGINT;
  3250. BEGIN
  3251.   ASM
  3252.     MOVE.L  A6,-(A7)
  3253.     MOVE.L  pat,D1
  3254.     MOVE.L  buf,D2
  3255.     MOVE.L  buflen,D3
  3256.     MOVEA.L _DOSBase,A6
  3257.     JSR -840(A6)
  3258.     MOVEA.L (A7)+,A6
  3259.     MOVE.L  D0,@RESULT
  3260.   END;
  3261. END;
  3262.  
  3263. FUNCTION ParsePatternNoCase(pat : pCHAR; buf : pCHAR; buflen : LONGINT) : LONGINT;
  3264. BEGIN
  3265.   ASM
  3266.     MOVE.L  A6,-(A7)
  3267.     MOVE.L  pat,D1
  3268.     MOVE.L  buf,D2
  3269.     MOVE.L  buflen,D3
  3270.     MOVEA.L _DOSBase,A6
  3271.     JSR -966(A6)
  3272.     MOVEA.L (A7)+,A6
  3273.     MOVE.L  D0,@RESULT
  3274.   END;
  3275. END;
  3276.  
  3277. FUNCTION PathPart(path : pCHAR) : pCHAR;
  3278. BEGIN
  3279.   ASM
  3280.     MOVE.L  A6,-(A7)
  3281.     MOVE.L  path,D1
  3282.     MOVEA.L _DOSBase,A6
  3283.     JSR -876(A6)
  3284.     MOVEA.L (A7)+,A6
  3285.     MOVE.L  D0,@RESULT
  3286.   END;
  3287. END;
  3288.  
  3289. FUNCTION PrintFault(code : LONGINT; header : pCHAR) : BOOLEAN;
  3290. BEGIN
  3291.   ASM
  3292.     MOVE.L  A6,-(A7)
  3293.     MOVE.L  code,D1
  3294.     MOVE.L  header,D2
  3295.     MOVEA.L _DOSBase,A6
  3296.     JSR -474(A6)
  3297.     MOVEA.L (A7)+,A6
  3298.     TST.W   D0
  3299.     BEQ.B   @end
  3300.     MOVEQ   #1,D0
  3301.   @end: MOVE.B  D0,@RESULT
  3302.   END;
  3303. END;
  3304.  
  3305. FUNCTION PutStr(str : pCHAR) : BOOLEAN;
  3306. BEGIN
  3307.   ASM
  3308.     MOVE.L  A6,-(A7)
  3309.     MOVE.L  str,D1
  3310.     MOVEA.L _DOSBase,A6
  3311.     JSR -948(A6)
  3312.     MOVEA.L (A7)+,A6
  3313.     TST.L   D0
  3314.     BEQ.B   @end
  3315.     MOVEQ   #1,D0
  3316.     @end: MOVE.B  D0,@RESULT
  3317.   END;
  3318. END;
  3319.  
  3320. FUNCTION ReadArgs(arg_template : pCHAR; VAR arra : LONGINT; args : pRDArgs) : pRDArgs;
  3321. BEGIN
  3322.   ASM
  3323.     MOVE.L  A6,-(A7)
  3324.     MOVE.L  arg_template,D1
  3325.     MOVE.L  arra,D2
  3326.     MOVE.L  args,D3
  3327.     MOVEA.L _DOSBase,A6
  3328.     JSR -798(A6)
  3329.     MOVEA.L (A7)+,A6
  3330.     MOVE.L  D0,@RESULT
  3331.   END;
  3332. END;
  3333.  
  3334. FUNCTION ReadItem(name : pCHAR; maxchars : LONGINT; cSource : pCSource) : LONGINT;
  3335. BEGIN
  3336.   ASM
  3337.     MOVE.L  A6,-(A7)
  3338.     MOVE.L  name,D1
  3339.     MOVE.L  maxchars,D2
  3340.     MOVE.L  cSource,D3
  3341.     MOVEA.L _DOSBase,A6
  3342.     JSR -810(A6)
  3343.     MOVEA.L (A7)+,A6
  3344.     MOVE.L  D0,@RESULT
  3345.   END;
  3346. END;
  3347.  
  3348. FUNCTION ReadLink(port : pMsgPort; lock : LONGINT; path : pCHAR; buffer : pCHAR; size : ULONG) : BOOLEAN;
  3349. BEGIN
  3350.   ASM
  3351.     MOVE.L  A6,-(A7)
  3352.     MOVE.L  port,D1
  3353.     MOVE.L  lock,D2
  3354.     MOVE.L  path,D3
  3355.     MOVE.L  buffer,D4
  3356.     MOVE.L  size,D5
  3357.     MOVEA.L _DOSBase,A6
  3358.     JSR -438(A6)
  3359.     MOVEA.L (A7)+,A6
  3360.     TST.L   D0
  3361.     BEQ.B   @end
  3362.     MOVEQ   #1,D0
  3363.     @end: MOVE.B  D0,@RESULT
  3364.   END;
  3365. END;
  3366.  
  3367. FUNCTION Relabel(drive : pCHAR; newname : pCHAR) : BOOLEAN;
  3368. BEGIN
  3369.   ASM
  3370.     MOVE.L  A6,-(A7)
  3371.     MOVE.L  drive,D1
  3372.     MOVE.L  newname,D2
  3373.     MOVEA.L _DOSBase,A6
  3374.     JSR -720(A6)
  3375.     MOVEA.L (A7)+,A6
  3376.     TST.L   D0
  3377.     BEQ.B   @end
  3378.     MOVEQ   #1,D0
  3379.     @end: MOVE.B  D0,@RESULT
  3380.   END;
  3381. END;
  3382.  
  3383. FUNCTION RemAssignList(name : pCHAR; lock : LONGINT) : BOOLEAN;
  3384. BEGIN
  3385.   ASM
  3386.     MOVE.L  A6,-(A7)
  3387.     MOVE.L  name,D1
  3388.     MOVE.L  lock,D2
  3389.     MOVEA.L _DOSBase,A6
  3390.     JSR -636(A6)
  3391.     MOVEA.L (A7)+,A6
  3392.     TST.L   D0
  3393.     BEQ.B   @end
  3394.     MOVEQ   #1,D0
  3395.     @end: MOVE.B  D0,@RESULT
  3396.   END;
  3397. END;
  3398.  
  3399. FUNCTION RemDosEntry(dlist : pDosList) : BOOLEAN;
  3400. BEGIN
  3401.   ASM
  3402.     MOVE.L  A6,-(A7)
  3403.     MOVE.L  dlist,D1
  3404.     MOVEA.L _DOSBase,A6
  3405.     JSR -672(A6)
  3406.     MOVEA.L (A7)+,A6
  3407.     TST.W   D0
  3408.     BEQ.B   @end
  3409.     MOVEQ   #1,D0
  3410.   @end: MOVE.B  D0,@RESULT
  3411.   END;
  3412. END;
  3413.  
  3414. FUNCTION RemSegment(seg : pSegment) : BOOLEAN;
  3415. BEGIN
  3416.   ASM
  3417.     MOVE.L  A6,-(A7)
  3418.     MOVE.L  seg,D1
  3419.     MOVEA.L _DOSBase,A6
  3420.     JSR -786(A6)
  3421.     MOVEA.L (A7)+,A6
  3422.     TST.L   D0
  3423.     BEQ.B   @end
  3424.     MOVEQ   #1,D0
  3425.     @end: MOVE.B  D0,@RESULT
  3426.   END;
  3427. END;
  3428.  
  3429. PROCEDURE ReplyPkt(dp : pDosPacket; res1 : LONGINT; res2 : LONGINT);
  3430. BEGIN
  3431.   ASM
  3432.     MOVE.L  A6,-(A7)
  3433.     MOVE.L  dp,D1
  3434.     MOVE.L  res1,D2
  3435.     MOVE.L  res2,D3
  3436.     MOVEA.L _DOSBase,A6
  3437.     JSR -258(A6)
  3438.     MOVEA.L (A7)+,A6
  3439.   END;
  3440. END;
  3441.  
  3442. FUNCTION RunCommand(seg : LONGINT; stack : LONGINT; paramptr : pCHAR; paramlen : LONGINT) : LONGINT;
  3443. BEGIN
  3444.   ASM
  3445.     MOVE.L  A6,-(A7)
  3446.     MOVE.L  seg,D1
  3447.     MOVE.L  stack,D2
  3448.     MOVE.L  paramptr,D3
  3449.     MOVE.L  paramlen,D4
  3450.     MOVEA.L _DOSBase,A6
  3451.     JSR -504(A6)
  3452.     MOVEA.L (A7)+,A6
  3453.     MOVE.L  D0,@RESULT
  3454.   END;
  3455. END;
  3456.  
  3457. FUNCTION SameDevice(lock1 : LONGINT; lock2 : LONGINT) : BOOLEAN;
  3458. BEGIN
  3459.   ASM
  3460.     MOVE.L  A6,-(A7)
  3461.     MOVE.L  lock1,D1
  3462.     MOVE.L  lock2,D2
  3463.     MOVEA.L _DOSBase,A6
  3464.     JSR -984(A6)
  3465.     MOVEA.L (A7)+,A6
  3466.     TST.W   D0
  3467.     BEQ.B   @end
  3468.     MOVEQ   #1,D0
  3469.   @end: MOVE.B  D0,@RESULT
  3470.   END;
  3471. END;
  3472.  
  3473. FUNCTION SameLock(lock1 : LONGINT; lock2 : LONGINT) : LONGINT;
  3474. BEGIN
  3475.   ASM
  3476.     MOVE.L  A6,-(A7)
  3477.     MOVE.L  lock1,D1
  3478.     MOVE.L  lock2,D2
  3479.     MOVEA.L _DOSBase,A6
  3480.     JSR -420(A6)
  3481.     MOVEA.L (A7)+,A6
  3482.     MOVE.L  D0,@RESULT
  3483.   END;
  3484. END;
  3485.  
  3486. FUNCTION SelectInput(fh : LONGINT) : LONGINT;
  3487. BEGIN
  3488.   ASM
  3489.     MOVE.L  A6,-(A7)
  3490.     MOVE.L  fh,D1
  3491.     MOVEA.L _DOSBase,A6
  3492.     JSR -294(A6)
  3493.     MOVEA.L (A7)+,A6
  3494.     MOVE.L  D0,@RESULT
  3495.   END;
  3496. END;
  3497.  
  3498. FUNCTION SelectOutput(fh : LONGINT) : LONGINT;
  3499. BEGIN
  3500.   ASM
  3501.     MOVE.L  A6,-(A7)
  3502.     MOVE.L  fh,D1
  3503.     MOVEA.L _DOSBase,A6
  3504.     JSR -300(A6)
  3505.     MOVEA.L (A7)+,A6
  3506.     MOVE.L  D0,@RESULT
  3507.   END;
  3508. END;
  3509.  
  3510. PROCEDURE SendPkt(dp : pDosPacket; port : pMsgPort; replyport : pMsgPort);
  3511. BEGIN
  3512.   ASM
  3513.     MOVE.L  A6,-(A7)
  3514.     MOVE.L  dp,D1
  3515.     MOVE.L  port,D2
  3516.     MOVE.L  replyport,D3
  3517.     MOVEA.L _DOSBase,A6
  3518.     JSR -246(A6)
  3519.     MOVEA.L (A7)+,A6
  3520.   END;
  3521. END;
  3522.  
  3523. FUNCTION SetArgStr(string_ : pCHAR) : BOOLEAN;
  3524. BEGIN
  3525.   ASM
  3526.     MOVE.L  A6,-(A7)
  3527.     MOVE.L  string_,D1
  3528.     MOVEA.L _DOSBase,A6
  3529.     JSR -540(A6)
  3530.     MOVEA.L (A7)+,A6
  3531.     TST.W   D0
  3532.     BEQ.B   @end
  3533.     MOVEQ   #1,D0
  3534.   @end: MOVE.B  D0,@RESULT
  3535.   END;
  3536. END;
  3537.  
  3538. FUNCTION SetComment(name : pCHAR; comment : pCHAR) : BOOLEAN;
  3539. BEGIN
  3540.   ASM
  3541.     MOVE.L  A6,-(A7)
  3542.     MOVE.L  name,D1
  3543.     MOVE.L  comment,D2
  3544.     MOVEA.L _DOSBase,A6
  3545.     JSR -180(A6)
  3546.     MOVEA.L (A7)+,A6
  3547.     TST.L   D0
  3548.     BEQ.B   @end
  3549.     MOVEQ   #1,D0
  3550.     @end: MOVE.B  D0,@RESULT
  3551.   END;
  3552. END;
  3553.  
  3554. FUNCTION SetConsoleTask(task : pMsgPort) : pMsgPort;
  3555. BEGIN
  3556.   ASM
  3557.     MOVE.L  A6,-(A7)
  3558.     MOVE.L  task,D1
  3559.     MOVEA.L _DOSBase,A6
  3560.     JSR -516(A6)
  3561.     MOVEA.L (A7)+,A6
  3562.     MOVE.L  D0,@RESULT
  3563.   END;
  3564. END;
  3565.  
  3566. FUNCTION SetCurrentDirName(name : pCHAR) : BOOLEAN;
  3567. BEGIN
  3568.   ASM
  3569.     MOVE.L  A6,-(A7)
  3570.     MOVE.L  name,D1
  3571.     MOVEA.L _DOSBase,A6
  3572.     JSR -558(A6)
  3573.     MOVEA.L (A7)+,A6
  3574.     TST.W   D0
  3575.     BEQ.B   @end
  3576.     MOVEQ   #1,D0
  3577.   @end: MOVE.B  D0,@RESULT
  3578.   END;
  3579. END;
  3580.  
  3581. FUNCTION SetFileDate(name : pCHAR; date : pDateStamp) : BOOLEAN;
  3582. BEGIN
  3583.   ASM
  3584.     MOVE.L  A6,-(A7)
  3585.     MOVE.L  name,D1
  3586.     MOVE.L  date,D2
  3587.     MOVEA.L _DOSBase,A6
  3588.     JSR -396(A6)
  3589.     MOVEA.L (A7)+,A6
  3590.     TST.L   D0
  3591.     BEQ.B   @end
  3592.     MOVEQ   #1,D0
  3593.     @end: MOVE.B  D0,@RESULT
  3594.   END;
  3595. END;
  3596.  
  3597. FUNCTION SetFileSize(fh : LONGINT; pos : LONGINT; mode : LONGINT) : BOOLEAN;
  3598. BEGIN
  3599.   ASM
  3600.     MOVE.L  A6,-(A7)
  3601.     MOVE.L  fh,D1
  3602.     MOVE.L  pos,D2
  3603.     MOVE.L  mode,D3
  3604.     MOVEA.L _DOSBase,A6
  3605.     JSR -456(A6)
  3606.     MOVEA.L (A7)+,A6
  3607.     TST.L   D0
  3608.     BEQ.B   @end
  3609.     MOVEQ   #1,D0
  3610.     @end: MOVE.B  D0,@RESULT
  3611.   END;
  3612. END;
  3613.  
  3614. FUNCTION SetFileSysTask(task : pMsgPort) : pMsgPort;
  3615. BEGIN
  3616.   ASM
  3617.     MOVE.L  A6,-(A7)
  3618.     MOVE.L  task,D1
  3619.     MOVEA.L _DOSBase,A6
  3620.     JSR -528(A6)
  3621.     MOVEA.L (A7)+,A6
  3622.     MOVE.L  D0,@RESULT
  3623.   END;
  3624. END;
  3625.  
  3626. FUNCTION SetIoErr(result : LONGINT) : LONGINT;
  3627. BEGIN
  3628.   ASM
  3629.     MOVE.L  A6,-(A7)
  3630.     MOVE.L  result,D1
  3631.     MOVEA.L _DOSBase,A6
  3632.     JSR -462(A6)
  3633.     MOVEA.L (A7)+,A6
  3634.     MOVE.L  D0,@RESULT
  3635.   END;
  3636. END;
  3637.  
  3638. FUNCTION SetMode(fh : LONGINT; mode : LONGINT) : BOOLEAN;
  3639. BEGIN
  3640.   ASM
  3641.     MOVE.L  A6,-(A7)
  3642.     MOVE.L  fh,D1
  3643.     MOVE.L  mode,D2
  3644.     MOVEA.L _DOSBase,A6
  3645.     JSR -426(A6)
  3646.     MOVEA.L (A7)+,A6
  3647.     TST.L   D0
  3648.     BEQ.B   @end
  3649.     MOVEQ   #1,D0
  3650.     @end: MOVE.B  D0,@RESULT
  3651.   END;
  3652. END;
  3653.  
  3654. FUNCTION SetOwner(name : pCHAR; owner_info : LONGINT) : BOOLEAN;
  3655. BEGIN
  3656.   ASM
  3657.     MOVE.L  A6,-(A7)
  3658.     MOVE.L  name,D1
  3659.     MOVE.L  owner_info,D2
  3660.     MOVEA.L _DOSBase,A6
  3661.     JSR -996(A6)
  3662.     MOVEA.L (A7)+,A6
  3663.     TST.W   D0
  3664.     BEQ.B   @end
  3665.     MOVEQ   #1,D0
  3666.   @end: MOVE.B  D0,@RESULT
  3667.   END;
  3668. END;
  3669.  
  3670. FUNCTION SetProgramDir(lock : LONGINT) : LONGINT;
  3671. BEGIN
  3672.   ASM
  3673.     MOVE.L  A6,-(A7)
  3674.     MOVE.L  lock,D1
  3675.     MOVEA.L _DOSBase,A6
  3676.     JSR -594(A6)
  3677.     MOVEA.L (A7)+,A6
  3678.     MOVE.L  D0,@RESULT
  3679.   END;
  3680. END;
  3681.  
  3682. FUNCTION SetProgramName(name : pCHAR) : BOOLEAN;
  3683. BEGIN
  3684.   ASM
  3685.     MOVE.L  A6,-(A7)
  3686.     MOVE.L  name,D1
  3687.     MOVEA.L _DOSBase,A6
  3688.     JSR -570(A6)
  3689.     MOVEA.L (A7)+,A6
  3690.     TST.W   D0
  3691.     BEQ.B   @end
  3692.     MOVEQ   #1,D0
  3693.   @end: MOVE.B  D0,@RESULT
  3694.   END;
  3695. END;
  3696.  
  3697. FUNCTION SetPrompt(name : pCHAR) : BOOLEAN;
  3698. BEGIN
  3699.   ASM
  3700.     MOVE.L  A6,-(A7)
  3701.     MOVE.L  name,D1
  3702.     MOVEA.L _DOSBase,A6
  3703.     JSR -582(A6)
  3704.     MOVEA.L (A7)+,A6
  3705.     TST.W   D0
  3706.     BEQ.B   @end
  3707.     MOVEQ   #1,D0
  3708.   @end: MOVE.B  D0,@RESULT
  3709.   END;
  3710. END;
  3711.  
  3712. FUNCTION SetProtection(name : pCHAR; protect : LONGINT) : BOOLEAN;
  3713. BEGIN
  3714.   ASM
  3715.     MOVE.L  A6,-(A7)
  3716.     MOVE.L  name,D1
  3717.     MOVE.L  protect,D2
  3718.     MOVEA.L _DOSBase,A6
  3719.     JSR -186(A6)
  3720.     MOVEA.L (A7)+,A6
  3721.     TST.L   D0
  3722.     BEQ.B   @end
  3723.     MOVEQ   #1,D0
  3724.     @end: MOVE.B  D0,@RESULT
  3725.   END;
  3726. END;
  3727.  
  3728. FUNCTION SetVar(name : pCHAR; buffer : pCHAR; size : LONGINT; flags : LONGINT) : BOOLEAN;
  3729. BEGIN
  3730.   ASM
  3731.     MOVE.L  A6,-(A7)
  3732.     MOVE.L  name,D1
  3733.     MOVE.L  buffer,D2
  3734.     MOVE.L  size,D3
  3735.     MOVE.L  flags,D4
  3736.     MOVEA.L _DOSBase,A6
  3737.     JSR -900(A6)
  3738.     MOVEA.L (A7)+,A6
  3739.     TST.W   D0
  3740.     BEQ.B   @end
  3741.     MOVEQ   #1,D0
  3742.   @end: MOVE.B  D0,@RESULT
  3743.   END;
  3744. END;
  3745.  
  3746. FUNCTION SetVBuf(fh : LONGINT; buff : pCHAR; type_ : LONGINT; size : LONGINT) : BOOLEAN;
  3747. BEGIN
  3748.   ASM
  3749.     MOVE.L  A6,-(A7)
  3750.     MOVE.L  fh,D1
  3751.     MOVE.L  buff,D2
  3752.     MOVE.L  type_,D3
  3753.     MOVE.L  size,D4
  3754.     MOVEA.L _DOSBase,A6
  3755.     JSR -366(A6)
  3756.     MOVEA.L (A7)+,A6
  3757.     TST.L   D0
  3758.     BEQ.B   @end
  3759.     MOVEQ   #1,D0
  3760.     @end: MOVE.B  D0,@RESULT
  3761.   END;
  3762. END;
  3763.  
  3764. FUNCTION SplitName(name : pCHAR; seperator : ULONG; buf : pCHAR; oldpos : LONGINT; size : LONGINT) : INTEGER;
  3765. BEGIN
  3766.   ASM
  3767.     MOVE.L  A6,-(A7)
  3768.     MOVE.L  name,D1
  3769.     MOVE.L  seperator,D2
  3770.     MOVE.L  buf,D3
  3771.     MOVE.L  oldpos,D4
  3772.     MOVE.L  size,D5
  3773.     MOVEA.L _DOSBase,A6
  3774.     JSR -414(A6)
  3775.     MOVEA.L (A7)+,A6
  3776.     MOVE.L  D0,@RESULT
  3777.   END;
  3778. END;
  3779.  
  3780. FUNCTION StartNotify(notify : pNotifyRequest) : BOOLEAN;
  3781. BEGIN
  3782.   ASM
  3783.     MOVE.L  A6,-(A7)
  3784.     MOVE.L  notify,D1
  3785.     MOVEA.L _DOSBase,A6
  3786.     JSR -888(A6)
  3787.     MOVEA.L (A7)+,A6
  3788.     TST.W   D0
  3789.     BEQ.B   @end
  3790.     MOVEQ   #1,D0
  3791.   @end: MOVE.B  D0,@RESULT
  3792.   END;
  3793. END;
  3794.  
  3795. FUNCTION StrToDate(datetime : pDateTime) : BOOLEAN;
  3796. BEGIN
  3797.   ASM
  3798.     MOVE.L  A6,-(A7)
  3799.     MOVE.L  datetime,D1
  3800.     MOVEA.L _DOSBase,A6
  3801.     JSR -750(A6)
  3802.     MOVEA.L (A7)+,A6
  3803.     TST.L   D0
  3804.     BEQ.B   @end
  3805.     MOVEQ   #1,D0
  3806.     @end: MOVE.B  D0,@RESULT
  3807.   END;
  3808. END;
  3809.  
  3810. FUNCTION StrToLong(string_ : pCHAR; VAR value : LONGINT) : LONGINT;
  3811. BEGIN
  3812.   ASM
  3813.     MOVE.L  A6,-(A7)
  3814.     MOVE.L  string_,D1
  3815.     MOVE.L  value,D2
  3816.     MOVEA.L _DOSBase,A6
  3817.     JSR -816(A6)
  3818.     MOVEA.L (A7)+,A6
  3819.     MOVE.L  D0,@RESULT
  3820.   END;
  3821. END;
  3822.  
  3823. FUNCTION SystemTagList(command : pCHAR; tags : pTagItem) : LONGINT;
  3824. BEGIN
  3825.   ASM
  3826.     MOVE.L  A6,-(A7)
  3827.     MOVE.L  command,D1
  3828.     MOVE.L  tags,D2
  3829.     MOVEA.L _DOSBase,A6
  3830.     JSR -606(A6)
  3831.     MOVEA.L (A7)+,A6
  3832.     MOVE.L  D0,@RESULT
  3833.   END;
  3834. END;
  3835.  
  3836. FUNCTION DOSSystem(command : pCHAR; tags : pTagItem) : LONGINT;
  3837. BEGIN
  3838.   ASM
  3839.     MOVE.L  A6,-(A7)
  3840.     MOVE.L  command,D1
  3841.     MOVE.L  tags,D2
  3842.     MOVEA.L _DOSBase,A6
  3843.     JSR -606(A6)
  3844.     MOVEA.L (A7)+,A6
  3845.     MOVE.L  D0,@RESULT
  3846.   END;
  3847. END;
  3848.  
  3849. FUNCTION UnGetC(fh : LONGINT; character : LONGINT) : LONGINT;
  3850. BEGIN
  3851.   ASM
  3852.     MOVE.L  A6,-(A7)
  3853.     MOVE.L  fh,D1
  3854.     MOVE.L  character,D2
  3855.     MOVEA.L _DOSBase,A6
  3856.     JSR -318(A6)
  3857.     MOVEA.L (A7)+,A6
  3858.     MOVE.L  D0,@RESULT
  3859.   END;
  3860. END;
  3861.  
  3862. PROCEDURE UnLoadSeg(seglist : LONGINT);
  3863. BEGIN
  3864.   ASM
  3865.     MOVE.L  A6,-(A7)
  3866.     MOVE.L  seglist,D1
  3867.     MOVEA.L _DOSBase,A6
  3868.     JSR -156(A6)
  3869.     MOVEA.L (A7)+,A6
  3870.   END;
  3871. END;
  3872.  
  3873. PROCEDURE UnLock(lock : LONGINT);
  3874. BEGIN
  3875.   ASM
  3876.     MOVE.L  A6,-(A7)
  3877.     MOVE.L  lock,D1
  3878.     MOVEA.L _DOSBase,A6
  3879.     JSR -090(A6)
  3880.     MOVEA.L (A7)+,A6
  3881.   END;
  3882. END;
  3883.  
  3884. PROCEDURE UnLockDosList(flags : ULONG);
  3885. BEGIN
  3886.   ASM
  3887.     MOVE.L  A6,-(A7)
  3888.     MOVE.L  flags,D1
  3889.     MOVEA.L _DOSBase,A6
  3890.     JSR -660(A6)
  3891.     MOVEA.L (A7)+,A6
  3892.   END;
  3893. END;
  3894.  
  3895. FUNCTION UnLockRecord(fh : LONGINT; offset : ULONG; length : ULONG) : BOOLEAN;
  3896. BEGIN
  3897.   ASM
  3898.     MOVE.L  A6,-(A7)
  3899.     MOVE.L  fh,D1
  3900.     MOVE.L  offset,D2
  3901.     MOVE.L  length,D3
  3902.     MOVEA.L _DOSBase,A6
  3903.     JSR -282(A6)
  3904.     MOVEA.L (A7)+,A6
  3905.     TST.W   D0
  3906.     BEQ.B   @end
  3907.     MOVEQ   #1,D0
  3908.   @end: MOVE.B  D0,@RESULT
  3909.   END;
  3910. END;
  3911.  
  3912. FUNCTION UnLockRecords(recArray : pRecordLock) : BOOLEAN;
  3913. BEGIN
  3914.   ASM
  3915.     MOVE.L  A6,-(A7)
  3916.     MOVE.L  recArray,D1
  3917.     MOVEA.L _DOSBase,A6
  3918.     JSR -288(A6)
  3919.     MOVEA.L (A7)+,A6
  3920.     TST.W   D0
  3921.     BEQ.B   @end
  3922.     MOVEQ   #1,D0
  3923.   @end: MOVE.B  D0,@RESULT
  3924.   END;
  3925. END;
  3926.  
  3927. FUNCTION VFPrintf(fh : LONGINT; format : pCHAR; argarray : POINTER) : LONGINT;
  3928. BEGIN
  3929.   ASM
  3930.     MOVE.L  A6,-(A7)
  3931.     MOVE.L  fh,D1
  3932.     MOVE.L  format,D2
  3933.     MOVE.L  argarray,D3
  3934.     MOVEA.L _DOSBase,A6
  3935.     JSR -354(A6)
  3936.     MOVEA.L (A7)+,A6
  3937.     MOVE.L  D0,@RESULT
  3938.   END;
  3939. END;
  3940.  
  3941. PROCEDURE VFWritef(fh : LONGINT; format : pCHAR; VAR argarray : LONGINT);
  3942. BEGIN
  3943.   ASM
  3944.     MOVE.L  A6,-(A7)
  3945.     MOVE.L  fh,D1
  3946.     MOVE.L  format,D2
  3947.     MOVE.L  argarray,D3
  3948.     MOVEA.L _DOSBase,A6
  3949.     JSR -348(A6)
  3950.     MOVEA.L (A7)+,A6
  3951.   END;
  3952. END;
  3953.  
  3954. FUNCTION VPrintf(format : pCHAR; argarray : POINTER) : LONGINT;
  3955. BEGIN
  3956.   ASM
  3957.     MOVE.L  A6,-(A7)
  3958.     MOVE.L  format,D1
  3959.     MOVE.L  argarray,D2
  3960.     MOVEA.L _DOSBase,A6
  3961.     JSR -954(A6)
  3962.     MOVEA.L (A7)+,A6
  3963.     MOVE.L  D0,@RESULT
  3964.   END;
  3965. END;
  3966.  
  3967. FUNCTION WaitForChar(file_ : LONGINT; timeout : LONGINT) : BOOLEAN;
  3968. BEGIN
  3969.   ASM
  3970.     MOVE.L  A6,-(A7)
  3971.     MOVE.L  file_,D1
  3972.     MOVE.L  timeout,D2
  3973.     MOVEA.L _DOSBase,A6
  3974.     JSR -204(A6)
  3975.     MOVEA.L (A7)+,A6
  3976.     TST.L   D0
  3977.     BEQ.B   @end
  3978.     MOVEQ   #1,D0
  3979.     @end: MOVE.B  D0,@RESULT
  3980.   END;
  3981. END;
  3982.  
  3983. FUNCTION WaitPkt : pDosPacket;
  3984. BEGIN
  3985.   ASM
  3986.     MOVE.L  A6,-(A7)
  3987.     MOVEA.L _DOSBase,A6
  3988.     JSR -252(A6)
  3989.     MOVEA.L (A7)+,A6
  3990.     MOVE.L  D0,@RESULT
  3991.   END;
  3992. END;
  3993.  
  3994. FUNCTION WriteChars(buf : pCHAR; buflen : ULONG) : LONGINT;
  3995. BEGIN
  3996.   ASM
  3997.     MOVE.L  A6,-(A7)
  3998.     MOVE.L  buf,D1
  3999.     MOVE.L  buflen,D2
  4000.     MOVEA.L _DOSBase,A6
  4001.     JSR -942(A6)
  4002.     MOVEA.L (A7)+,A6
  4003.     MOVE.L  D0,@RESULT
  4004.   END;
  4005. END;
  4006.  
  4007. END. (* UNIT DOS *)
  4008.  
  4009.